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

◆ DrawSelf()

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

Reimplemented from Terraria.UI.UIElement.

Definition at line 142 of file UISearchBar.cs.

143 {
144 base.DrawSelf(spriteBatch);
145 if (!isWritingText)
146 {
147 return;
148 }
149 PlayerInput.WritingText = true;
150 Main.instance.HandleIME();
151 Vector2 position = new Vector2(Main.screenWidth / 2, _text.GetDimensions().ToRectangle().Bottom + 32);
152 Main.instance.DrawWindowsIMEPanel(position, 0.5f);
153 string inputText = Main.GetInputText(actualContents);
154 if (Main.inputTextEnter)
155 {
157 }
158 else if (Main.inputTextEscape)
159 {
161 if (this.OnCanceledTakingInput != null)
162 {
164 }
165 }
166 SetContents(inputText);
167 position = new Vector2(Main.screenWidth / 2, _text.GetDimensions().ToRectangle().Bottom + 32);
168 Main.instance.DrawWindowsIMEPanel(position, 0.5f);
169 }
void SetContents(string contents, bool forced=false)

References Terraria.GameContent.UI.Elements.UISearchBar._text, Terraria.GameContent.UI.Elements.UISearchBar.actualContents, Terraria.Main.GetInputText(), Terraria.Main.inputTextEnter, Terraria.Main.inputTextEscape, Terraria.Main.instance, Terraria.GameContent.UI.Elements.UISearchBar.isWritingText, Terraria.GameContent.UI.Elements.UISearchBar.OnCanceledTakingInput, Terraria.Main.screenWidth, Terraria.GameContent.UI.Elements.UISearchBar.SetContents(), Terraria.GameContent.UI.Elements.UISearchBar.ToggleTakingText(), and Microsoft.Xna.Framework.Graphics.Vector2.