public override void Draw() { _contentBorder.Draw(Game.SpriteBatch); if (!string.IsNullOrEmpty(Title)) { _headerBorder.Draw(Game.SpriteBatch); Game.SpriteBatch.DrawString(_headerFont, Title, new Vector2(_headerBorder.Bounds.X + _headerBorder.FixedBorder.Left, _headerBorder.Bounds.Y + _headerBorder.FixedBorder.Top), Color.White); } base.Draw(); }
public override void Draw() { _border.Draw(Game.SpriteBatch); _spriteText.Draw(Game.SpriteBatch); if (_isCursorVisible && _hasFocus) { var bounds = _spriteText.GetBounds(true); Game.ShapeRenderer.DrawRectangle(bounds.Right + 1, bounds.Y, 1, bounds.Height, Color.White); } }
public override void Draw() { if (IsMouseOver) { _hoverSprite.Draw(Game.SpriteBatch); } else { _normalSprite.Draw(Game.SpriteBatch); } base.Draw(); }
public override void Draw(SpriteBatch spriteBatch) { if (string.IsNullOrEmpty(Text)) { return; } var bounds = GetBounds(); var textSize = Resources.NormalFont.MeasureString(Text); var position = new Vector2(bounds.X + bounds.Width * 0.5f - textSize.X * 0.5f, bounds.Y + bounds.Height * 0.5f - textSize.Y * 0.5f).SnapToPixels(); spriteBatch.DrawString(Resources.NormalFont, Text, position, Color.White); if (State == UiState.Focused) { _currentSprite.SetBounds(bounds); _currentSprite.Draw(spriteBatch); } }
public override void Draw(SpriteBatch spriteBatch) { _sprite.Draw(spriteBatch, GetBounds()); }
public override void Draw() { _ninePatch.Draw(Game.SpriteBatch); _ninePatch.Draw(Game.SpriteBatch, new Rectangle(X, Y, Width, Height)); }