Game Development Community

Screen-Res

by yurembo · in Torque 2D Beginner · 11/05/2013 (12:51 am) · 2 replies

Hello all!
I develop a game for 1280 x 800 screen-resolution. My rectangle textures are widen by X-axis.
How can I resolve this task?
Mobile devices have many others screen-resolutions.
Could I prepare different size pictures to different resolutions?

#1
11/05/2013 (6:39 am)
Set your scene camera dimensions to the correct aspect ratio.

Currently you probably have something like
TestSceneWindow.setCameraSize( 100, 75 ); // 4:3 aspect ratio

You'd probably rather use something like
TestSceneWindow.setCameraSize( 120, 75 ); // 8:5
#2
11/06/2013 (4:40 am)
You don't have to prepare different size pictures to different resolutions .. you could handle this easily:

// get info on current device's resolution
%res = getDesktopResolution();
$desktopWidth=getWord(%res,0);
$desktopHeight=getWord(%res,1);
$bpp=getWord(%res,2);

// set screen resolution
setScreenMode($desktopWidth , $desktopHeight , $bpp, $fullScreen);

// depending on the aspect ratio of the current resolution we set our camera size
%ratio=$desktopWidth/$desktopHeight;
if (%ratio>1.34) mySceneWindow.setCameraSize(120, 75);
else mySceneWindow.setCameraSize(100, 75);