Game Development Community

Forcing a smaller resolution if fullscreen mode?

by Eero Karvonen · in Torque 2D Beginner · 12/11/2014 (12:44 pm) · 1 replies

Hi,
I'm trying to change the screen mode to 800x600x16 on OS X 10.8, but no matter what default preferences I change or what modes I apply after the canvas has been created, I get no change.

The log always says this first (although I've changed the resolution in preferences.cs and defaultPreferences.cs):
set screen mode 1024 x 768 x 16, fullscreen, force it, dont repaint

After this it says,
set screen mode 800 x 600 x 16, fullscreen, dont force it, repaint
as I try to change the resolution with,
setScreenMode(800,600,16,1);
.
But this does nothing. So what's the use?

Is it even possible in T2D to change the fullscreen resolution to smaller than this? Or do you, guys, do this by zooming the camera in? That wouldn't be an optimal solution for pixel art.

#1
09/17/2015 (12:13 pm)
Sorry nobody ever answered this. You've probably long since moved on but I'll answer anyway.

There's a good chance that your monitor doesn't have 800x600 as a resolution. In window mode you can do any resolution you want, but in full screen mode you have to pick a resolution that the monitor can do. You can get this list using getResolutionList().

What I do, based on code by Vern Jensen, is find the size of the current desktop using getDesktopResolution() and then set it to full screen with those same dimensions. Next I calculate out the ratio of the width and height and adjust all my scene windows match - to avoid stretching. And really it's the ratio that matters. Setting the screen to fullscreen 800x600 is the same as fullscreen 1600x1200. You just expand the scene windows to match the size. The camera doesn't need to be zoomed in.