Making a game for multiple resolutions

Started by
1 comment, last by TrieBr 13 years, 7 months ago
I'm currently working with an API that allows you to develop games for the iPhone, along with other platforms.

The biggest problem I have been having, is the fact that the devices all use different resolutions, specifically the iPhone 3gs and the iPhone 4 where the iPhone 4 has double the resolution.

The easiest way I can think of, which is still quite tedious, and annoying.. Is having multiple Render steps, so the appropriate render step would be executed based on the resolution, and each render step would render all entities for the resolution. This would require essentially writing the render step for each entity multiple times for multiple resolutions.. There is also landscape/portrait mode that will need to be accounted for, which means entities will need to be rendered based on the orientation AND resolution of the screen.

This would be easy in 3D, but 2D makes it a lot more difficult.

Any suggestions on how to do this?
Advertisement
Quote:Original post by TrieBr
Any suggestions on how to do this?
Resolution independent 2D is not as complicated as you are making it out to be.

1) You can draw your screen to a texture at a set resolution, and then render it as a full screen quad.

2) You can treat your screen as 0-1 coordinates and then draw everything in a resolution independent way.

3) You can pretend the screen is a set resolution, and then translate all your drawing coordinates with a custom drawing function.

etc...
etc...
etc...


Method 1 is braindead simple, and all 3 methods will give you the same on screen results. Just know that changing the aspect ratio of the sprites, or the whole screen will make them look bad.
Method 1 was what I was originally thinking, but I'm working on mobile devices which need to be light on memory usage. I'll try some tests out to see if it works..

Method 2 wont work because the devices don't have an FPU for floating points.

Method 3 sounds great. I could just make a function that will scale and draw the image in a scaled position.


Thanks for the suggestions :D

This topic is closed to new replies.

Advertisement