Game Development Community

How to modify the text in a GUITextctrl through in game code?

by Ryan Linn · in Torque Game Builder · 09/12/2009 (5:48 pm) · 2 replies

Hi I'm having a bit of a stumbling point at the moment so I thought I might get some help from the community.

I have a GUI with a GUITextCtrl which I want to have change depending on various conditions. What I need to know though is how to set what text is displayed in the GUITextCtrl via code or if that even possible.

Thanks for any help you can provide.

About the author

Recent Threads


#1
09/13/2009 (12:06 pm)
What do you mean by change? Just change the text displayed?

You need to name the control in the GUI editor, for example textcontrol

In script you can do either textcontrol.SetText("text here"); or textcontrol.text = "text here";
#2
09/13/2009 (11:08 pm)
Yeah I meant change the displayed text.

Thanks for the tip it really helped me get it working. I really appreciate it.