public override void Update(GameTime gameTime)
        {
            if (Active)
            {
                Vector2 textSize = SampleText.Length > 0 ? SampleText.Size(TextFont) : TextSize;
                TextPosition = new Vector2(Left + TextOffset.X, Top + TextOffset.Y);


                if (IsClicked)
                {
                    if (MouseGUI.LeftIsPressed && MouseGUI.Focus != this)
                    {
                        MouseEvent.Out();
                    }
                    OnKeyboardPressed();

                    UpdatePointer(gameTime);
                }
                base.Update(gameTime);
            }

            if (Property != null)
            {
                Property.Update(gameTime);
            }
        }
        public override void Update(GameTime gameTime)
        {
            if (Active)
            {
                UpdateResize();

                MaxLinesLength = Height / (Pointer.Height - 3);


                TextPosition = new Vector2(Left + TextOffset.X, Top);

                if (IsClicked && !Editable)
                {
                    OnKeyboardPressed();
                    ApplyTextOffset();
                }


                //ApplyTextOffset();
                UpdateCharacters();
                UpdatePointer(gameTime);


                if (MouseGUI.LeftIsPressed && MouseGUI.Focus != this)
                {
                    ReceivingInput = false;
                    MouseEvent.Out();
                }
                if (NumberOfLines > MaxLinesLength + 1)
                {
                    _scrollBar.Show();
                }
                else
                {
                    _scrollBar.Hide();
                }


                _scrollBar.Position = new Point(Right - _scrollBar.Width, Top);
                _scrollBar.Update(gameTime);
            }
            if (Property != null)
            {
                Property.Update(gameTime);
            }
        }
Example #3
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            if (Active)
            {
                if (!Contains(MouseGUI.Position))
                {
                    IsMouseOver = false;
                    MouseEvent.Out();
                }
                Caption.Position  = new  Point(Rect.Center.X, Rect.Center.Y);
                Caption.Position -= new Point(Caption.Width / 2, Caption.Height / 2);
                Caption.Update(gameTime);
            }

            if (Property != null)
            {
                Property.Update(gameTime);
            }
        }