Maximized Window Dev (for those that miss the maximize button!)
by Leroy Frederick · in Torque Game Builder · 06/24/2006 (4:36 am) · 0 replies
I don't how many people will find this useful if any, but it works for me (i prefer this then the fullscreen method).
Ok, basicially, if you want to take advantage of all the window/screen space while in the level/tile/gui editor (without the exclusive fullscreen method) this is for you. All you have to do is use the setNewScreenMode() function as demostarted below:
heres the complete function, place it wherever you like in your project, you could even put this in the 'main.cs' of the games directory (which in turn would make it available to all your projects):
So where do you use it to set the correct screen size from start, mid game and back again? Well in the 'main.cs' file of your project directory put the following in the 'initializeProject()' function after all the file exec commands (or at least after the exec that contains your 'setNewScreenMode' function):
Now place this in the 'game.cs' file of your project's 'gameScripts' directory within the 'startGame(%level)' function:
Finally, place this in the same script file as above within the 'endGame()' function (this will ensure that when you go from game to level editor, the screen is set back to the dev default res)
Remember, you can set the resolution to whatever size you and graphics card desires/can handle, but you must minus the dev environment height by 20 (hence the '%newRes="1024 748"') or you won't be able to see the top File menus!
There maybe a better and/or easier way of doing this, some may deem it unnecessary, but hey, I like it, vintage TGB! I've only been using TGB for 2 weeks or so, so if my codes a little dodgy or misinformed, forgive me in advance ;) If you have any improvements please share.
EDIT: Oh, and gg, please tell me if there's any potential problems with this little setup i've rigged? :)
EDIT: Updated function, made some errors with the if check (using == instead of $= on string check)
Ok, basicially, if you want to take advantage of all the window/screen space while in the level/tile/gui editor (without the exclusive fullscreen method) this is for you. All you have to do is use the setNewScreenMode() function as demostarted below:
setScreenMode( firstWord( %newRes ), getWord( %newRes, 1 ), %newBpp, %newFullScreen );
heres the complete function, place it wherever you like in your project, you could even put this in the 'main.cs' of the games directory (which in turn would make it available to all your projects):
function setNewScreenMode(%newRes, %newBpp, %newFullScreen)
{
if (%newRes $= "devDefault") { %newRes="1024 748"; %newBpp=32; %newFullScreen=0; }
if (%newRes $= "gameDefault") { %newRes="800 600"; %newBpp=32; %newFullScreen=0; }
setScreenMode( firstWord( %newRes ), getWord( %newRes, 1 ), %newBpp, %newFullScreen );
error("------------New Screen Resolution Setup!!!------------");
}So where do you use it to set the correct screen size from start, mid game and back again? Well in the 'main.cs' file of your project directory put the following in the 'initializeProject()' function after all the file exec commands (or at least after the exec that contains your 'setNewScreenMode' function):
//Rem Update Resolution to Dev environment default
setNewScreenMode("devDefault");Now place this in the 'game.cs' file of your project's 'gameScripts' directory within the 'startGame(%level)' function:
//Rem Start the Game with this set resolution
setNewScreenMode("gameDefault");Finally, place this in the same script file as above within the 'endGame()' function (this will ensure that when you go from game to level editor, the screen is set back to the dev default res)
//Rem Update Resolution to Dev environment default
setNewScreenMode("devDefault");Remember, you can set the resolution to whatever size you and graphics card desires/can handle, but you must minus the dev environment height by 20 (hence the '%newRes="1024 748"') or you won't be able to see the top File menus!
There maybe a better and/or easier way of doing this, some may deem it unnecessary, but hey, I like it, vintage TGB! I've only been using TGB for 2 weeks or so, so if my codes a little dodgy or misinformed, forgive me in advance ;) If you have any improvements please share.
EDIT: Oh, and gg, please tell me if there's any potential problems with this little setup i've rigged? :)
EDIT: Updated function, made some errors with the if check (using == instead of $= on string check)