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

◆ DrawSplicedPanel()

static void Terraria.Utils.DrawSplicedPanel ( SpriteBatch sb,
Texture2D texture,
int x,
int y,
int w,
int h,
int leftEnd,
int rightEnd,
int topEnd,
int bottomEnd,
Color c )
inlinestatic

Definition at line 1964 of file Utils.cs.

1965 {
1966 if (w < leftEnd + rightEnd)
1967 {
1968 w = leftEnd + rightEnd;
1969 }
1970 if (h < topEnd + bottomEnd)
1971 {
1972 h = topEnd + bottomEnd;
1973 }
1974 sb.Draw(texture, new Rectangle(x, y, leftEnd, topEnd), new Rectangle(0, 0, leftEnd, topEnd), c);
1975 sb.Draw(texture, new Rectangle(x + leftEnd, y, w - leftEnd - rightEnd, topEnd), new Rectangle(leftEnd, 0, texture.Width - leftEnd - rightEnd, topEnd), c);
1976 sb.Draw(texture, new Rectangle(x + w - rightEnd, y, topEnd, rightEnd), new Rectangle(texture.Width - rightEnd, 0, rightEnd, topEnd), c);
1977 sb.Draw(texture, new Rectangle(x, y + topEnd, leftEnd, h - topEnd - bottomEnd), new Rectangle(0, topEnd, leftEnd, texture.Height - topEnd - bottomEnd), c);
1978 sb.Draw(texture, new Rectangle(x + leftEnd, y + topEnd, w - leftEnd - rightEnd, h - topEnd - bottomEnd), new Rectangle(leftEnd, topEnd, texture.Width - leftEnd - rightEnd, texture.Height - topEnd - bottomEnd), c);
1979 sb.Draw(texture, new Rectangle(x + w - rightEnd, y + topEnd, rightEnd, h - topEnd - bottomEnd), new Rectangle(texture.Width - rightEnd, topEnd, rightEnd, texture.Height - topEnd - bottomEnd), c);
1980 sb.Draw(texture, new Rectangle(x, y + h - bottomEnd, leftEnd, bottomEnd), new Rectangle(0, texture.Height - bottomEnd, leftEnd, bottomEnd), c);
1981 sb.Draw(texture, new Rectangle(x + leftEnd, y + h - bottomEnd, w - leftEnd - rightEnd, bottomEnd), new Rectangle(leftEnd, texture.Height - bottomEnd, texture.Width - leftEnd - rightEnd, bottomEnd), c);
1982 sb.Draw(texture, new Rectangle(x + w - rightEnd, y + h - bottomEnd, rightEnd, bottomEnd), new Rectangle(texture.Width - rightEnd, texture.Height - bottomEnd, rightEnd, bottomEnd), c);
1983 }
void Draw(Texture2D texture, Vector2 position, Color color)

References Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Microsoft.Xna.Framework.Graphics.Texture2D.Height, and Microsoft.Xna.Framework.Graphics.Texture2D.Width.

Referenced by Terraria.Main.DrawHairWindow(), Terraria.GameContent.UI.Elements.UIWorkshopPublishResourcePackListItem.DrawPanel(), Terraria.GameContent.UI.Elements.UIWorkshopPublishWorldListItem.DrawPanel(), Terraria.GameContent.UI.Elements.GroupOptionButton< T >.DrawSelf(), Terraria.GameContent.UI.Elements.UICharacterNameButton.DrawSelf(), Terraria.GameContent.UI.Elements.UIClothStyleButton.DrawSelf(), Terraria.GameContent.UI.Elements.UIDifficultyButton.DrawSelf(), Terraria.GameContent.UI.Elements.UIIconTextButton.DrawSelf(), Terraria.GameContent.UI.Elements.UIResourcePackInfoButton< T >.DrawSelf(), Terraria.GameContent.UI.Elements.UISelectableTextPanel< T >.DrawSelf(), Terraria.GameContent.UI.Elements.UISlicedImage.DrawSelf(), Terraria.GameContent.UI.Elements.UIColoredSliderSimple.DrawValueBarDynamicWidth(), and Terraria.GameContent.UI.Elements.UIVerticalSlider.DrawValueBarDynamicWidth().