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!

pimpampoum
  • 5,816
  • 6
  • 24
  • 27

1 Answers1

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.

Community
  • 1
  • 1
kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
  • Hey Kenny, could you please tell me what you mean by "@2x" in little more detail? – Dave O. Jun 12 '10 at 12:08
  • @Dave: Say, if you have a 15x27 image `foo.png`, then you create a 30x54 `foo@2x.png`. iPhone 4 will pick up the latter whenever you need `foo.png`. See the SDK doc for detail. – kennytm Jun 12 '10 at 15:16