Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ DrawSelf()

override void Terraria.GameContent.UI.Elements.UIWorldCreationPreview.DrawSelf ( SpriteBatch spriteBatch)
inlineprotectedvirtual

Reimplemented from Terraria.UI.UIElement.

Definition at line 71 of file UIWorldCreationPreview.cs.

72 {
73 CalculatedStyle dimensions = GetDimensions();
74 Vector2 position = new Vector2(dimensions.X + 4f, dimensions.Y + 4f);
75 Color color = Color.White;
76 switch (_difficulty)
77 {
78 case 0:
79 case 3:
80 spriteBatch.Draw(_BackgroundNormalTexture.Value, position, Color.White);
81 color = Color.White;
82 break;
83 case 1:
84 spriteBatch.Draw(_BackgroundExpertTexture.Value, position, Color.White);
85 color = Color.DarkGray;
86 break;
87 case 2:
88 spriteBatch.Draw(_BackgroundMasterTexture.Value, position, Color.White);
89 color = Color.DarkGray;
90 break;
91 }
92 switch (_size)
93 {
94 case 0:
95 spriteBatch.Draw(_SizeSmallTexture.Value, position, color);
96 break;
97 case 1:
98 spriteBatch.Draw(_SizeMediumTexture.Value, position, color);
99 break;
100 case 2:
101 spriteBatch.Draw(_SizeLargeTexture.Value, position, color);
102 break;
103 }
104 switch (_evil)
105 {
106 case 0:
107 spriteBatch.Draw(_EvilRandomTexture.Value, position, color);
108 break;
109 case 1:
110 spriteBatch.Draw(_EvilCorruptionTexture.Value, position, color);
111 break;
112 case 2:
113 spriteBatch.Draw(_EvilCrimsonTexture.Value, position, color);
114 break;
115 }
116 switch (_difficulty)
117 {
118 case 0:
119 spriteBatch.Draw(_BunnyNormalTexture.Value, position, color);
120 break;
121 case 1:
122 spriteBatch.Draw(_BunnyExpertTexture.Value, position, color);
123 break;
124 case 2:
125 spriteBatch.Draw(_BunnyMasterTexture.Value, position, color * 1.2f);
126 break;
127 case 3:
128 spriteBatch.Draw(_BunnyCreativeTexture.Value, position, color);
129 break;
130 }
131 spriteBatch.Draw(_BorderTexture.Value, new Vector2(dimensions.X, dimensions.Y), Color.White);
132 }
void Draw(Texture2D texture, Vector2 position, Color color)
CalculatedStyle GetDimensions()
Definition UIElement.cs:382

References Terraria.GameContent.UI.Elements.UIWorldCreationPreview._BackgroundExpertTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._BackgroundMasterTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._BackgroundNormalTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._BorderTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._BunnyCreativeTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._BunnyExpertTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._BunnyMasterTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._BunnyNormalTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._difficulty, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._evil, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._EvilCorruptionTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._EvilCrimsonTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._EvilRandomTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._size, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._SizeLargeTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._SizeMediumTexture, Terraria.GameContent.UI.Elements.UIWorldCreationPreview._SizeSmallTexture, Microsoft.Xna.Framework.Color.DarkGray, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.UI.UIElement.GetDimensions(), ReLogic.Content.Asset< T >.Value, Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Color.White, Terraria.UI.CalculatedStyle.X, and Terraria.UI.CalculatedStyle.Y.