design and camera resolution
by USC - IMD student 2 · in Torque Game Builder · 02/10/2009 (4:23 pm) · 3 replies
In the level editor it seems like always a good idea to make the camera width and height the same ratio as the design resolution. But to run games in fullscreen you really have to give the user the option to change the screen resolution in realtime by keybinding:
Canvas.pushDialog(optionsDlg);
…because in my world there are plenty of monitors that are both 4:3 and 16:10. But if you change the resolution so the ratio is different from camera ratio then the world is either stretched or squished. I feel like I can only target users of one ratio or the other.
What am I missing here?
About the author
#2
Nikos, your second option sounds appealing, but since changing the screen resolution (that also changes the ratio) stretches the gui as well my side black bars (that you recommended) stay in the same relative place, regardless of the horz and vertSizing settings, it doesn't do what I hoped. I've worked with Torque gui's for years and I still don't feel I know what I'm doing with them, so maybe I'm missing something.
-------
This is what I've tested. I see how making levels and gui's that are specific to the ratio works. At your menu screen, you ask the user if they are 4:3 or 16:10 and load accordingly. They can then change to ANY resolution (even during the game), and things look good. But it is tough to tweak levels and gui's if you have to do two every time.
-------
Or I could pick two screen resolutions and use
------
Separately, I tried forcing the camera during runtime based on what resolution they choose:
-----
Also, I tried:
but that crashes the game.
----------
Normally I am humbled by the help I get on these forums because I am always learning, but this time I feel like my question is relevant to 100% of TGB users today. So I would appreciate some detailed feedback from the community :)
02/12/2009 (11:02 am)
I'm a jerk for saying it, but how can any TGB developer not have this issue?Nikos, your second option sounds appealing, but since changing the screen resolution (that also changes the ratio) stretches the gui as well my side black bars (that you recommended) stay in the same relative place, regardless of the horz and vertSizing settings, it doesn't do what I hoped. I've worked with Torque gui's for years and I still don't feel I know what I'm doing with them, so maybe I'm missing something.
-------
This is what I've tested. I see how making levels and gui's that are specific to the ratio works. At your menu screen, you ask the user if they are 4:3 or 16:10 and load accordingly. They can then change to ANY resolution (even during the game), and things look good. But it is tough to tweak levels and gui's if you have to do two every time.
-------
Or I could pick two screen resolutions and use
setScreenMode(1024,768, 32,1); or setScreenMode(1280,800, 32,1);...etc, assuming I like those resolutions. I would also have to change the camera at the same time. And not give the user any further choices in runtime.
------
Separately, I tried forcing the camera during runtime based on what resolution they choose:
%x = getWord(sceneWindow2D.getCurrentCameraArea(), 0); %y = getWord(sceneWindow2D.getCurrentCameraArea(), 1); %w = getWord(sceneWindow2D.getCurrentCameraArea(), 2); %h = getWord(sceneWindow2D.getCurrentCameraArea(), 3); sceneWindow2D.setCurrentCameraArea(%x SPC %y SPC 128 SPC 80);...but that sizes the game screen down into the top left corner a way I don't understand...even when I choose the exact same width and height I started with.
-----
Also, I tried:
t2dScene.cameraSize = "128 80";
but that crashes the game.
----------
Normally I am humbled by the help I get on these forums because I am always learning, but this time I feel like my question is relevant to 100% of TGB users today. So I would appreciate some detailed feedback from the community :)
#3
02/12/2009 (11:09 am)
grrr. Don't know why this isn't in the private forums....hope it doesn't matter as I won't cross-post
Torque Owner Nikos Beck