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

◆ DrawSavingsMoney()

override void Terraria.GameContent.UI.CustomCurrencySingleCoin.DrawSavingsMoney ( SpriteBatch sb,
string text,
float shopx,
float shopy,
long totalCoins,
bool horizontal = false )
inlinevirtual

Reimplemented from Terraria.GameContent.UI.CustomCurrencySystem.

Definition at line 75 of file CustomCurrencySingleCoin.cs.

76 {
77 int num = _valuePerUnit.Keys.ElementAt(0);
78 Main.instance.LoadItem(num);
79 Texture2D value = TextureAssets.Item[num].Value;
80 if (horizontal)
81 {
82 _ = 99;
83 Vector2 position = new Vector2(shopx + ChatManager.GetStringSize(FontAssets.MouseText.Value, text, Vector2.One).X + 45f, shopy + 50f);
84 sb.Draw(value, position, null, Color.White, 0f, value.Size() / 2f, CurrencyDrawScale, SpriteEffects.None, 0f);
85 Utils.DrawBorderStringFourWay(sb, FontAssets.ItemStack.Value, totalCoins.ToString(), position.X - 11f, position.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f);
86 }
87 else
88 {
89 int num2 = ((totalCoins > 99) ? (-6) : 0);
90 sb.Draw(value, new Vector2(shopx + 11f, shopy + 75f), null, Color.White, 0f, value.Size() / 2f, CurrencyDrawScale, SpriteEffects.None, 0f);
91 Utils.DrawBorderStringFourWay(sb, FontAssets.ItemStack.Value, totalCoins.ToString(), shopx + (float)num2, shopy + 75f, Color.White, Color.Black, new Vector2(0.3f), 0.75f);
92 }
93 }
void Draw(Texture2D texture, Vector2 position, Color color)
static Vector2 GetStringSize(DynamicSpriteFont font, string text, Vector2 baseScale, float maxWidth=-1f)

References Terraria.GameContent.UI.CustomCurrencySystem._valuePerUnit, Microsoft.Xna.Framework.Color.Black, Terraria.GameContent.UI.CustomCurrencySingleCoin.CurrencyDrawScale, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.Utils.DrawBorderStringFourWay(), Terraria.UI.Chat.ChatManager.GetStringSize(), Terraria.Main.instance, Terraria.GameContent.TextureAssets.Item, Terraria.GameContent.FontAssets.ItemStack, System.Collections.Generic.Dictionary< TKey, TValue >.Keys, Terraria.GameContent.FontAssets.MouseText, Microsoft.Xna.Framework.Vector2.One, System.text, System.value, Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Color.White, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.