Gui Scripting command
by Xavier "eXoDuS" Amado · in Torque Game Engine · 04/14/2002 (10:03 am) · 2 replies
If you call a function from within a button you do something like command = "myfunction(%myparameter);";
but that if the function is defined alone:
function myfunction(%myparameter){};
what if i define the function inside the gui for example:
MyGui::myfunction(%this, %myparameter){};
how would i call it from the gui?
i tried
command = "MyGui::myfunction(%myparameter);";
but the paremeter didnt got through
but that if the function is defined alone:
function myfunction(%myparameter){};
what if i define the function inside the gui for example:
MyGui::myfunction(%this, %myparameter){};
how would i call it from the gui?
i tried
command = "MyGui::myfunction(%myparameter);";
but the paremeter didnt got through
About the author
#2
after looking a bit more i found out i was calling it with :: instead of . in the command :)
stupid me :D
thanks anyway
04/14/2002 (10:48 am)
kewl thanksafter looking a bit more i found out i was calling it with :: instead of . in the command :)
stupid me :D
thanks anyway
Torque 3D Owner Robert Blanchet Jr.
if(!isObject(SomeObject)) { new ScriptObject(SomeObject) { class = SomeObject; activated = 0; }; } function SomeObject::activate(%this) { // do something %this.activated = true; }And then in your Gui code, say for a button, the command would be this: