Checkers demo question
by Scott Johnson · in Torque Game Builder · 07/17/2006 (10:26 pm) · 5 replies
I'm looking at the checkersdemo's game.cs file startGame(%level) function.
at the end:
onStartUp();
LoadStartup();
I know what onStartup(); does.
but I can not for the life of me find LoadStartup();
I even did a search in files for the whole games folder... no avail.
EDIT:
Didn't search enough, it was in the splashscreen.gui file.. Doh!
at the end:
onStartUp();
LoadStartup();
I know what onStartup(); does.
but I can not for the life of me find LoadStartup();
I even did a search in files for the whole games folder... no avail.
EDIT:
Didn't search enough, it was in the splashscreen.gui file.. Doh!
About the author
#2
Such that I could have:
mainScreen.gui <- includes only the GUI elements
mainScreen.cs <- houses the scripts for the GUI
So far I haven't seen a problem, just wanted to be sure.
07/21/2006 (6:44 am)
Yeah, it's kind of wierd how the script can be mixed around different files, Other than "ease of use" is there any requirement that functions be included within .gui files? Such that I could have:
mainScreen.gui <- includes only the GUI elements
mainScreen.cs <- houses the scripts for the GUI
So far I haven't seen a problem, just wanted to be sure.
#3
07/21/2006 (8:54 am)
That is absolutely fine as long as your mainScreen.cs has been exec'd at the time mainScreen.gui needs to call the scripts.
#4
07/21/2006 (1:16 pm)
Yeah, you can do it either way. Personally I like writing scripts in the GUIs in some cases, though in other cases not so much. In that case I took the splash screen from a previous demo so I left it alone. Just make sure any script you add is after the //OBJECT WRITE END block, otherwise if you edit that GUI in the GUI Editor it will overwrite the scripts.
#5
As long as you leave the BEGIN and END comments in place, you're fine. You can put anything you want above or below the generated gui code. It is also fine to manually edit the gui code.
07/22/2006 (9:42 am)
Actually, you can put extra code before the //--- OBJECT WRITE BEGIN --- as well. Your file can basically have this structure:// you can put anything you want up here
//--- OBJECT WRITE BEGIN ---
// gui element code is generated in here
//--- OBJECT WRITE END ---
// you can put anything you want down hereAs long as you leave the BEGIN and END comments in place, you're fine. You can put anything you want above or below the generated gui code. It is also fine to manually edit the gui code.
Torque 3D Owner Matthew Langley
Torque