Game Development Community

How to refresh the GUI?

by Remi Freiwald · in Torque Game Engine · 07/06/2005 (7:22 am) · 8 replies

Hi!

I was fooling around with the engine delivered with 3DGPAi1 and I created a label called label1.

When i run the following function, the text of the label is changed but it doesn't appear on the screen, until i hit F10 and then hit the apply-button.

function labelupdate(%newlabeltext)
{
label1.text=%newlabeltext;
}

Is there a command to refresh the GUI?

something like:

function labelupdate(%newlabeltext)
{
label1.text=%newlabeltext;
refreshgui();
}

#1
07/06/2005 (8:10 am)
Try label1.setValue("new text");
#2
07/06/2005 (9:32 am)
OK, forget it! I'm dumb! I found my mistake... sorry... ;)

argh, matthew, you were faster than me... now it looks like i would have found the mistake with your help and now i'm claiming i did find it on myself... ;)
#3
07/06/2005 (9:37 am)
EDIT: Sometimes it just takes a second look over and you catch things :) Happens to me all the time.
#4
07/06/2005 (9:51 am)
Now i've got this function:

function labelupdate(%newtext)
{
label4.setValue(label3.getValue());
label3.setValue(label2.getValue());
label2.setValue(label1.getValue());
label1.setValue(%newtext);
}

this simulates those "chat/command/information/score-boxes" which tell you, that a player has connected and so on...

but there must be something that is really suited for this task, but i can't find it between all those label and buttoncontrols...

i know it exists, i've seen it in the torque-demo ;)
#5
07/06/2005 (9:59 am)
GuiMLTextCtrl is good for a Multi Line text control that you can put font and color tags... the GuiMessageVectorCtrl is nice too since you can create a MessageVector and attach it to the gui control and detach it if wanted
#6
07/06/2005 (10:24 am)
ML means MultiLine... yup, there it is! ;)

Are there any tutorials on the web about torque's GUI?
#7
07/06/2005 (10:28 am)
There are a couple in the official documentation

If you have T2D I'd direct you to a T2D tutorial of mine, its 88 pages and about 70-80% of it is about GUI's
#8
07/06/2005 (10:44 am)
The only torque-engine i've got is the one from 3DGPAi1...

The information in the official documentation is about basics like creating a new button...

I found this one: www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6482

It's pretty basic too, but at least i found out, that there's a performClick(); function...

I need tutorials which explain to me how to use such "advanced" gui-controls like GuiMessageVectorCtrl...
Or maybe i could figure most of it out on myself, if i knew what a message vector is?