Resolution/dynamic re-sizing - best approach?
#1
Posted 08 June 2012 - 09:59 PM
Naturally I need to re-size the game according to the device's screen size.
My first thought was to have a room of 1536x2048 (ipad3) and then set the view in the room to whatever need be (for instance, 768x1024 if run on an ipad2).
But this way, game objects will appear a lot smaller on an ipad3 than on an ipad2, because the view is just re-sized. This isn't optimal.
Can anyone suggest some way to keep the aspect ratio in another manner that keeps everything just about the same size no matter what iDevice it's run on? Currently I have all the graphics in the highest resolution (1536x2048). If possible I would very much like to avoid having more than one version of the graphics, as well as making more versions of the respectable rooms.
Thanks in advance.
#2
Posted 08 June 2012 - 10:26 PM
#3
Posted 09 June 2012 - 11:01 AM
#4
Posted 09 June 2012 - 12:49 PM
It stretches to fit, that is correct. However it looks sloppy and scaled if the device screen is too big/small compared to the game room/view, and it doesn't magically fix aspect ratio problems. What I am asking is how *I* can do something actively to make this look as pretty as possible on (at least) all iDevice (excluding iPods) resolutions.
If you want to make sure that it is going to look nice on all devices, you'll have to create different rooms with different sizes for all devices. Then check on startup which device the user is on and refer him to the related room.
#5
Posted 09 June 2012 - 12:56 PM
Whether a game is single screen or scrolling makes a big difference for example.
I'm not a big fan of the auto sizing/scaling/blurry stuff myself... (especially when it comes to the 99 bajillion different Android rezes).
Ya say you're just targeting iOS.
So ya have it easier.
If it were me & I had a game that I had *invested alotta time & effort in that I really believed could do well*, & I was concerned about making it extra sparkly on iPad3, & extra optimal/speedy on others, I would release 2 versions of the game:
1. "HD" iPad3 version @ 1536x2048 (with crazy texture pages).
2. "Standard" iPad2 version @768x1024 with fallbacks (view size changes/extra filler draw outside view/ whatever) to 640x960.
This is stuff that's best thought about in advance & the game built around this idea of it working/looking/playing just as well within a 768x1024 as a 640x960.
If I felt like even more suffering, I might also consider a third version for older (320x480) iPhones (rather than a scaledown that'd be eating FPS)... *if* speed was a problem.
This way you get the most out of each device...
but ya also have a massive timesink on your hands...
*&* the fiddlyness of marketing multiple versions of the same game, which could cause ya a lotta headaches.
*shrugs*
So yeah, there's no easy/magic solution here really (if that's whatchya were wondering).
Anyway, hope that helps.
Somehow.
#6
Posted 09 June 2012 - 01:50 PM
If you want to get rid of the portrait issue, check if the height > width and if so let a timer (5 steps) count down and then restart the game.
#7
Posted 09 June 2012 - 02:57 PM
Mark
#8
Posted 11 June 2012 - 02:24 PM
See my document http://www.gamemaker....com/gmios2.pdf for a solution that deals with the aspect ratio issue. It will still do scaling when required. If you want to avoid that you will have to do everything (including all sprites) at least double.
Mark
Mark, I adapted your code from the guide. All my graphics are in 768x1024, and so are all my rooms. On iPhone4 it looks perfect, but on iPad2 and iPad3 everything vertical is moshed together (a circle becomes more wide than tall etc.). I thought this took care of aspect ratios - am I doing something wrong?
Here is the code, exactly (I believe) as is in the pdf:
// Determine the size of the view
globalvar VIEW_WIDTH, VIEW_HEIGHT;
if (os_type = os_ios && os_device == device_ios_ipad)
{ VIEW_WIDTH = 768; VIEW_HEIGHT = 1024; }
else
{ VIEW_WIDTH = 640; VIEW_HEIGHT = 960; }
// Set the views in the rooms
room_set_view_enabled(rooStartscreen,true);
room_set_view(rooStartscreen,0,true,(768 - VIEW_WIDTH) div 2,
(1024 - VIEW_HEIGHT) div 2, VIEW_WIDTH, VIEW_HEIGHT,
0,0, VIEW_WIDTH, VIEW_HEIGHT,0,0,-1,-1,-1);
// Now go to the title menu room
room_goto(rooStartscreen);
Hope you (or someone else) can help me solve this. Thanks in advance.
#9
Posted 12 June 2012 - 11:43 AM
I'm close to just making 3 versions of every room, but seeing as there will be hundreds of levels, it would be very nice if there was some way around it - like hopefully the code above.
But right now, like I said, it squishes everything to be wider than taller on iPad2 and iPad3, whereas on iPhone4 it's perfect.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











