Game Development Community

How do I make full screen on TGB?

by Robert Carroll · in General Discussion · 09/09/2009 (3:32 am) · 2 replies

I was wondering if anyone knew how to make a TGB full screen when you play? And dose any one know what the cmd for loading a level is? Im kinda knew. Like onClick:"What would I put to make it load a level"

#1
02/07/2011 (6:22 pm)

how to make games run in fullscreen.


i couldn't find any reference to this either, so i just skimmed the gamescripts folder and took a lucky guess as to what needed to be modified.

inside the common folder, open gamescripts and then canvas.cs. line 32 should be the following...
setScreenMode( GetWord( %goodres, 0), GetWord( %goodres,1), GetWord( %goodres,2), false );
change the last value from false to true. now, the game will run in full screen.

i just figure this out a few minutes ago and it seems to work okay, except on mac i can't find a way to exit the game. mac users might want to bind a key, like esc, to quit the game.

how to load a level


well, based on levelManagement.cs I thought it'd be loadLevel(level1.t2d), but I couldn't get that to work. however, Eric Robinson explained the answer in this thread, you just need to call the expandFileName() function inside loadLevel(level1.t2d), like so...
sceneWindow2D.loadLevel(expandFilename("~/data/levels/level1.t2d"));
(where level1.t2d is the file for your level, of course.)
#2
02/07/2011 (9:33 pm)
This might do the trick:
toggleFullScreen()

Or this:
setScreenMode(int width, int height, int bpp, bool fullScreen)

These can go wherever you like, you don't have to change canvas.cs with these methods.