Game Development Community

How to script a GUI?

by Markus Nuebel · in Torque Game Engine · 12/19/2003 (5:54 am) · 4 replies

Hi all.

I have derived a guiBitmapCtrl from guiMouseEventCtrl, to track mouse movements over a bitmap.

But I have now idea, how to connect the new gui screen, that I have created with the GUI editor to a script that implements the onMouseXX methods.

Am I doing the connection, by assigning a name to the control in the editor (e.g. MyNewCtrl) and having script functions: e.g. MyNewCtrl::onMouseOver(); ??
If this is the case, how do I tell torque, what script to use for what dialog/control?

Best regards
-- Markus

#1
12/19/2003 (8:46 am)
Yes, that is how you do the connection.

You simply exec() the script file to load the functions into memory; Torque will find them on its own when it tries to call the onMouseOver().
#2
12/20/2003 (1:58 am)
Thanks Ben.

I got it to work now.

The hardest part, was to find out the signature of the onMouseXX functions.
For callbacks from the engine into script code is there another way, to find out about the signature, other than checking out where the engine calls the console function and having a look at it.

Some kind of comprehensive documentation?

-- Markus
#3
12/20/2003 (3:12 am)
For the C++-to-script callbacks? No, nothing yet. Someday...
#4
12/20/2003 (4:51 am)
I see. Thanks for the info Ben.

-- Markus