Ejemplo n.º 1
0
        public void Initialize(ContentManager content)
        {
            _buttons = new Button[BtnName.Length];

            for(var i = 0; i < _buttons.Length; i++)
            {
                _buttons[i] = new Button(new Rectangle((int)_btnCenter.X + (i * BtnWidth) + (i * BtnSpacing), (int)_btnCenter.Y,
                                         BtnWidth, BtnHeight), content, BtnName[i]);
            }

            _label[0] = new Label(_news.ReadTitle(), new Vector2(10, 10), content, Color.Red, GameData.ScreenSize.X - 250);
            _label[1] = new Label(_news.ReadNews(), new Vector2(10, 40), content, Color.Black, GameData.ScreenSize.X - 250);

            AddEventListernToControl();
        }
Ejemplo n.º 2
0
        public void Initialize(ContentManager content)
        {
            for (var i = 0; i < _textBox.Length; i++)
            {
                _textBox[i] = new TextBox(new Rectangle(100, i * 30 + 150, 250, 20), content,Color.Black);
            }

            _label = new Label[LblName.Length];
            for (var i = 0; i < _label.Length; i++)
            {
                _label[i] = new Label(LblName[i], new Vector2(10, i * 30 +  125), content, Color.Black, 20);
            }

            _buttons = new Button[BtnName.Length];

            for (var i = 0; i < _buttons.Length; i++)
            {
                _buttons[i] = new Button(new Rectangle(100 * i + 100, _textBox.Length * 30 + 150, 80, 20), content, BtnName[i]);
            }

            AddEventListernToControl();
        }