Exemplo n.º 1
0
        // Called when adding this element to a window
        // Adjusts its position to be properly placed in the window
        // Adjusts width to be the length of the window (minus the border) for easier clickability
        public override void addToWindow(Window window)
        {
            if (_rect.X < window.Border)
            {
                _rect.X = window.X + window.Border;
                _rect.Y += window.Y;
                if (_lockWidth)
                {
                    _rect.Width = window.Width - window.Border * 2;
                }
            }
            else
            {
                if (_lockWidth)
                {
                    _rect.Width = window.Width - window.Border * 2;

                }
                _rect.X += window.X;
                _rect.Y += window.Y;
            }

            // Wrap the text to the new width
            WrapText();
        }
Exemplo n.º 2
0
 public abstract void addToWindow(Window window);
Exemplo n.º 3
0
 public abstract void Draw(SpriteBatch spriteBatch, Color color, Window window);
Exemplo n.º 4
0
        // Will be used to draw only in the window
        public override void Draw(SpriteBatch spriteBatch, Color color, Window window)
        {
            spriteBatch.Draw(
                _texture,
                _rect,
                color);

            spriteBatch.DrawString(_font, _text, new Vector2(_rect.X, _rect.Y), Color.Black);
        }
Exemplo n.º 5
0
 public override void Draw(SpriteBatch spriteBatch, Color color, Window window)
 {
     return;
 }
Exemplo n.º 6
0
 public override void addToWindow(Window win)
 {
     return;
 }