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

◆ SetText() [2/2]

virtual void Terraria.GameContent.UI.Elements.UITextPanel< T >.SetText ( T text,
float textScale,
bool large )
inlinevirtual

Definition at line 95 of file UITextPanel.cs.

96 {
97 Vector2 textSize = new Vector2((large ? FontAssets.DeathText.Value : FontAssets.MouseText.Value).MeasureString(text.ToString()).X, large ? 32f : 16f) * textScale;
98 _text = text;
99 _textScale = textScale;
100 _textSize = textSize;
101 _isLarge = large;
102 MinWidth.Set(textSize.X + PaddingLeft + PaddingRight, 0f);
103 MinHeight.Set(textSize.Y + PaddingTop + PaddingBottom, 0f);
104 }
StyleDimension MinWidth
Definition UIElement.cs:35
StyleDimension MinHeight
Definition UIElement.cs:37
void Set(float pixels, float precent)

References Terraria.GameContent.UI.Elements.UITextPanel< T >._isLarge, Terraria.GameContent.UI.Elements.UITextPanel< T >._text, Terraria.GameContent.UI.Elements.UITextPanel< T >._textScale, Terraria.GameContent.UI.Elements.UITextPanel< T >._textSize, Terraria.GameContent.FontAssets.DeathText, Terraria.UI.UIElement.MinHeight, Terraria.UI.UIElement.MinWidth, Terraria.GameContent.FontAssets.MouseText, Terraria.UI.UIElement.PaddingBottom, Terraria.UI.UIElement.PaddingLeft, Terraria.UI.UIElement.PaddingRight, Terraria.UI.UIElement.PaddingTop, Terraria.UI.StyleDimension.Set(), Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.