// 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(); }
public abstract void addToWindow(Window window);
public abstract void Draw(SpriteBatch spriteBatch, Color color, Window window);
// 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); }
public override void Draw(SpriteBatch spriteBatch, Color color, Window window) { return; }
public override void addToWindow(Window win) { return; }