Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DrawPanel()

void Terraria.GameContent.UI.Elements.UIPanel.DrawPanel ( SpriteBatch spriteBatch,
Texture2D texture,
Color color )
inlineprivateinherited

Definition at line 50 of file UIPanel.cs.

51 {
52 CalculatedStyle dimensions = GetDimensions();
53 Point point = new Point((int)dimensions.X, (int)dimensions.Y);
54 Point point2 = new Point(point.X + (int)dimensions.Width - _cornerSize, point.Y + (int)dimensions.Height - _cornerSize);
55 int width = point2.X - point.X - _cornerSize;
56 int height = point2.Y - point.Y - _cornerSize;
57 spriteBatch.Draw(texture, new Rectangle(point.X, point.Y, _cornerSize, _cornerSize), new Rectangle(0, 0, _cornerSize, _cornerSize), color);
58 spriteBatch.Draw(texture, new Rectangle(point2.X, point.Y, _cornerSize, _cornerSize), new Rectangle(_cornerSize + _barSize, 0, _cornerSize, _cornerSize), color);
59 spriteBatch.Draw(texture, new Rectangle(point.X, point2.Y, _cornerSize, _cornerSize), new Rectangle(0, _cornerSize + _barSize, _cornerSize, _cornerSize), color);
60 spriteBatch.Draw(texture, new Rectangle(point2.X, point2.Y, _cornerSize, _cornerSize), new Rectangle(_cornerSize + _barSize, _cornerSize + _barSize, _cornerSize, _cornerSize), color);
61 spriteBatch.Draw(texture, new Rectangle(point.X + _cornerSize, point.Y, width, _cornerSize), new Rectangle(_cornerSize, 0, _barSize, _cornerSize), color);
62 spriteBatch.Draw(texture, new Rectangle(point.X + _cornerSize, point2.Y, width, _cornerSize), new Rectangle(_cornerSize, _cornerSize + _barSize, _barSize, _cornerSize), color);
63 spriteBatch.Draw(texture, new Rectangle(point.X, point.Y + _cornerSize, _cornerSize, height), new Rectangle(0, _cornerSize, _cornerSize, _barSize), color);
64 spriteBatch.Draw(texture, new Rectangle(point2.X, point.Y + _cornerSize, _cornerSize, height), new Rectangle(_cornerSize + _barSize, _cornerSize, _cornerSize, _barSize), color);
65 spriteBatch.Draw(texture, new Rectangle(point.X + _cornerSize, point.Y + _cornerSize, width, height), new Rectangle(_cornerSize, _cornerSize, _barSize, _barSize), color);
66 }
void Draw(Texture2D texture, Vector2 position, Color color)
CalculatedStyle GetDimensions()
Definition UIElement.cs:382

References Terraria.GameContent.UI.Elements.UIPanel._barSize, Terraria.GameContent.UI.Elements.UIPanel._cornerSize, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.UI.UIElement.GetDimensions(), Terraria.UI.CalculatedStyle.Height, Microsoft.Xna.Framework.Graphics.Point, Terraria.UI.CalculatedStyle.Width, Microsoft.Xna.Framework.Point.X, Terraria.UI.CalculatedStyle.X, Microsoft.Xna.Framework.Point.Y, and Terraria.UI.CalculatedStyle.Y.

Referenced by Terraria.GameContent.UI.Elements.UIBestiaryInfoItemLine.UIBestiaryInfoItemLine(), and Terraria.GameContent.UI.Elements.UIPanel.DrawSelf().