Graphics Sizes
by Gary Myers · in Torque 2D Beginner · 02/03/2014 (8:39 pm) · 2 replies
Sorry if this is documented somewhere, but didn't see anything in the official docs or forums.
Basically, I am trying to figure out what size to make my images for my game taking into account use on both iPhone4+ and iPad with/without Retina. Will T2D automatically choose a higher-def version of the file if the need is there (like the @2x suffix on standard iOS dev)? Or do I need to take that into account and load the higher-def version myself under certain conditions to maintain image quality? I don't want to force all platforms to load the large sizes because of memory limitations.
From a camera size, I've been playing around with the following to keep things "square".
Thanks!
-Gary
Basically, I am trying to figure out what size to make my images for my game taking into account use on both iPhone4+ and iPad with/without Retina. Will T2D automatically choose a higher-def version of the file if the need is there (like the @2x suffix on standard iOS dev)? Or do I need to take that into account and load the higher-def version myself under certain conditions to maintain image quality? I don't want to force all platforms to load the large sizes because of memory limitations.
From a camera size, I've been playing around with the following to keep things "square".
// Set the camera.
if (%ratio > 1.3 && %ratio <1.4) // not sure how accurate the match is with the 1.333333
{
// 4x3; iPad
SandboxWindow.setCameraSize( 40, 30 );
}
else if (%ratio == 1.5)
{
// iPhone 4
SandboxWindow.setCameraSize( 48, 32);
}
else if (%ratio == 1.6)
{
// 16x10; 1920x1200; 1440x900
SandboxWindow.setCameraSize( 48, 30);
}
else
{
// 16x9; iPhone5; 1080p;2560x1440p;1280x720
SandboxWindow.setCameraSize( 48, 27 );
}Thanks!
-Gary
About the author
#2
02/05/2014 (7:30 pm)
Thanks Mike! I figured that was the way it would be, but never hurts to check! The good news is that it would really be an issue for the iPads with Retina since the currently supported iPhones and non-Retina iPads are near enough resolution that the same assets sizes could be used interchangeably.
Associate Mike Lilligreen
Retired T2Der
I don't have any experience with using T2D for iOS development, but I have been tinkering with the asset system over the past few weeks. There is no automatic handling of low-def/high-def images in T2D. You will have to script your own system to assign the proper image asset based on device resolution.