Game Development Community

Full Resolution but Windowed

by James Staggs · in Torque Game Builder · 07/25/2015 (5:00 pm) · 1 replies

Hi, all! What I'm looking to accomplish is to have my game figure out what the current screen resolution is, set its extent to that, and stay windowed. That way it takes up the screen but is still in a window and you can mouse in and out of it easily, especially if you have 2 monitors.

Anyway, any help on being able to do that would be awesome.

Thanks!

JMS

#1
09/21/2015 (5:53 am)
That should be easy to do. Try this:

%info = getDesktopResolution();  
%width = getWord(%info, 0);  
%height = getWord(%info, 1);  
%depth = getWord(%info, 2); 

setScreenMode(%width, %height, %depth, false);

You'll need to adjust you cameras to match the ratio of the width and height. If you decide to do full screen later on you should do something similar to this so you don't mess up your user's screen resolution.