Game Development Community

What more is needed besides Canvas.setContent()?

by Mark Vargas · in Torque Game Engine · 11/12/2001 (5:20 am) · 3 replies

I'm currently trying to figure exact program flow of the example program. Here is basically what I have:

if(!createCanvas()) {
quit();
return;
}

exec("~/ui/defaultProfiles.cs");
exec("~/ui/mainMenuGui.gui");
// ... also loaded all the other guis from canvas.cs and various main.cs

Canvas.setContent( MainMenuGui );

If I comment out the last line everything runs fine, I am presented with a full blank screen. With that line active it doesn't even go blank full screen and just sits there, no dso files are created, so I assume it's hasn't even run. Is there something I'm missing? Also, is there an easy way to have Con::printf() output redirected to a file?

#1
11/12/2001 (6:52 am)
Hmm, its trying to create the main menu and insert it into the canvas. Have you made any changes to the main menu?

Phil.
#2
11/12/2001 (11:45 am)
No, copied directly from the example. Now, realize that I have no code other than that which I listed in the previous post + gui stuff, I copied the exe and dll files to a new directory, and this stuff is in main.cs.
#3
11/15/2001 (8:57 am)
Mark,
I am doing something much like that which you are doing, and I think I see the problem.

In order for the engine to exec anything in a subdirectory, a function called "setModPaths(...)" must be called. I'm not sure exactly what it does, but I believe it informs the engine of valid subdirectories.

"setModPaths" takes one string argument of the format:
"subdir;subdir;subdir"
and you can have as many subdirectories as necessary (I think); they must be separated with semicolons.

So I suggest that you make a subdir in the same folder of the main.cs you posted and put all of your menu gui/cs files in there. Then call "setModPaths" at the beginning of your posted main.cs with the string name of the new subdirectory as the argument.