Get device actual screen width and height..?

Hello!

I’m working on a game, and we are trying to set up the items on the screen for all possible (or as close to) devices.

My problem is with small screen devices, like the iPhone 4, where some of my object seem small, or too small, where on a different device with the same screen resolution, but larger screen (physically, inches and centimeters), and they look fine.

Is there a way for me to get the screens actual width and height (and not in pixels) so I could know when my app is on a small screen and thus show specific items larger?

Thanks.

Hi @formatc,

I don’t believe that actual screen size is exposed via iOS (it is in Android). However, you may want to explore basic device detection and other system info to determine that it’s running on an iPhone4 or similar. Here are two relevant links:

http://coronalabs.com/blog/2012/12/11/device-detection-on-steroids/

http://docs.coronalabs.com/api/library/system/getInfo.html

Take care,

Brent

Hi @formatc,

I don’t believe that actual screen size is exposed via iOS (it is in Android). However, you may want to explore basic device detection and other system info to determine that it’s running on an iPhone4 or similar. Here are two relevant links:

http://coronalabs.com/blog/2012/12/11/device-detection-on-steroids/

http://docs.coronalabs.com/api/library/system/getInfo.html

Take care,

Brent