public override void Draw(SpriteBatch spriteBatch) { if (IsMouseHovering) { Main.LocalPlayer.mouseInterface = true; } Vector2 pos = GetDimensions().ToRectangle().Center(); Color color = Color.Gray; if (IsMouseHovering) { color = Color.White; } if (active) { color = Color.Yellow; } ManualGeneratorMenu.DrawBox(spriteBatch, GetDimensions().ToRectangle(), IsMouseHovering || active ? new Color(49, 84, 141) : new Color(49, 84, 141) * 0.6f); Utils.DrawBorderString(spriteBatch, value.ToString(), pos + Vector2.UnitY * 4, color, 0.8f, 0.5f, 0.5f); base.Draw(spriteBatch); }
public override void Draw(SpriteBatch spriteBatch) { if (IsMouseHovering) { Main.LocalPlayer.mouseInterface = true; } Vector2 pos = GetDimensions().ToRectangle().TopLeft(); Rectangle mainBox = new Rectangle((int)pos.X, (int)pos.Y, 400, 32); Color color = Color.Gray; if (IsMouseHovering) { color = Color.White; } if (active) { color = Color.Yellow; } ManualGeneratorMenu.DrawBox(spriteBatch, mainBox, IsMouseHovering || active ? new Color(49, 84, 141) : new Color(49, 84, 141) * 0.6f); Utils.DrawBorderString(spriteBatch, Name, mainBox.Center() + Vector2.UnitY * 4, color, 0.8f, 0.5f, 0.5f); base.Draw(spriteBatch); if (!active) { Height.Set(32, 0); RemoveAllChildren(); } }