Jump to content
  • Advertisement
Sign in to follow this  
TrieBr

Making a game for multiple resolutions

This topic is 2953 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!