4

I just finish my iPhone game using cocos2d. But before I put it on the AppStore, I'd like to make it work on iPad (which have a bigger screen) and iPhone 4 (which have a bigger resolution).
So, how can I determine programmatically that my app is running on an iPhone, iPad or iPhone 4, to be able to use the correct coordinates / images in my game?

Thanks for your help!

2
  • Do you mean 'programmatically'?
    – BoltClock
    Jun 12, 2010 at 11:03
  • 1
    Well using code I guess? rather than asking the user
    – Pez Cuckow
    Jun 12, 2010 at 11:05

1 Answer 1

2

Between iPad and iPhoneAlready answered many times.

Between iPhone and iPhone 4 — The size reported is still 320×480, so you don't need to change anything about the coordinates. Create an @2x alternative for the images if you need a high resolution UI image.

2
  • Hey Kenny, could you please tell me what you mean by "@2x" in little more detail?
    – Dave O.
    Jun 12, 2010 at 12:08
  • @Dave: Say, if you have a 15x27 image foo.png, then you create a 30x54 [email protected]. iPhone 4 will pick up the latter whenever you need foo.png. See the SDK doc for detail.
    – kennytm
    Jun 12, 2010 at 15:16

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.