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

◆ Draw()

void Terraria.GameContent.UI.GameTipsDisplay.Draw ( )
inline

Definition at line 134 of file GameTipsDisplay.cs.

135 {
136 SpriteBatch spriteBatch = Main.spriteBatch;
137 float num = Main.screenWidth;
138 float y = Main.screenHeight - 150;
139 float num2 = (float)Main.screenWidth * 0.5f;
140 foreach (GameTip currentTip in _currentTips)
141 {
142 if (currentTip.ScreenAnchorX < -0.5f || currentTip.ScreenAnchorX > 1.5f)
143 {
144 continue;
145 }
146 DynamicSpriteFont value = FontAssets.MouseText.Value;
147 string text = value.CreateWrappedText(currentTip.Text, num2, Language.ActiveCulture.CultureInfo);
148 if (text.Split('\n').Length > 2)
149 {
150 text = value.CreateWrappedText(currentTip.Text, num2 * 1.5f - 50f, Language.ActiveCulture.CultureInfo);
151 }
152 if (WorldGen.getGoodWorldGen)
153 {
154 string text2 = "";
155 for (int num3 = text.Length - 1; num3 >= 0; num3--)
156 {
157 text2 += text.Substring(num3, 1);
158 }
159 text = text2;
160 }
161 else if (WorldGen.drunkWorldGenText)
162 {
163 text = string.Concat(Main.rand.Next(999999999));
164 for (int i = 0; i < 14; i++)
165 {
166 if (Main.rand.Next(2) == 0)
167 {
168 text += Main.rand.Next(999999999);
169 }
170 }
171 }
172 Vector2 vector = value.MeasureString(text);
173 float num4 = 1.1f;
174 float num5 = 110f;
175 if (vector.Y > num5)
176 {
177 num4 = num5 / vector.Y;
178 }
179 Vector2 position = new Vector2(num * currentTip.ScreenAnchorX, y);
180 position -= vector * num4 * 0.5f;
181 if (WorldGen.tenthAnniversaryWorldGen && !WorldGen.remixWorldGen)
182 {
183 ChatManager.DrawColorCodedStringWithShadow(spriteBatch, value, text, position, Color.HotPink, 0f, Vector2.Zero, new Vector2(num4, num4));
184 }
185 else
186 {
187 ChatManager.DrawColorCodedStringWithShadow(spriteBatch, value, text, position, Color.White, 0f, Vector2.Zero, new Vector2(num4, num4));
188 }
189 }
190 }
static GameCulture ActiveCulture
Definition Language.cs:8
static Vector2 DrawColorCodedStringWithShadow(SpriteBatch spriteBatch, DynamicSpriteFont font, TextSnippet[] snippets, Vector2 position, float rotation, Vector2 origin, Vector2 baseScale, out int hoveredSnippet, float maxWidth=-1f, float spread=2f)

References Terraria.GameContent.UI.GameTipsDisplay._currentTips, Terraria.Localization.Language.ActiveCulture, Terraria.UI.Chat.ChatManager.DrawColorCodedStringWithShadow(), Terraria.WorldGen.drunkWorldGenText, Terraria.WorldGen.getGoodWorldGen, Microsoft.Xna.Framework.Color.HotPink, Terraria.GameContent.FontAssets.MouseText, Terraria.Main.rand, Terraria.WorldGen.remixWorldGen, Terraria.Main.screenWidth, Terraria.Main.spriteBatch, Terraria.WorldGen.tenthAnniversaryWorldGen, Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Color.White, and Microsoft.Xna.Framework.Vector2.Zero.