Anyway to tell how big a device's screen is?

Is there anyway to tell how big a device’s screen is?

I am making a candy crush like game and I’d like to make a routine to take a “guess” at which button the player wanted to tap if the touch was not valid. Ideally I’d like to scale this distance check value by the device’s actual screen size. Ie an iPhone 4 would be very forgiving and an pad wouldn’t.

I figure no but thought I’d check anyway.

Thanks,

Gullie

Depending on your config.lua, you should be able to use display.actualContentHeight and display.actualContentWidth to get the screen’s dimensions.

Rob

Yeah… but that has no influence on DPI. For instance the iphone 4 and iphone 2 have the same size screen but different DPIs. 

Most config.lua’s give you a content area that is the same on all devices.  You don’t worry about DPI, Corona takes care of that.  Your button is X points from the left for example regardless of the device.

Only if you’re doing some adaptive content area (more for business apps and less for games) would you really need to worry about the size of the device.

Rob

Depending on your config.lua, you should be able to use display.actualContentHeight and display.actualContentWidth to get the screen’s dimensions.

Rob

Yeah… but that has no influence on DPI. For instance the iphone 4 and iphone 2 have the same size screen but different DPIs. 

Most config.lua’s give you a content area that is the same on all devices.  You don’t worry about DPI, Corona takes care of that.  Your button is X points from the left for example regardless of the device.

Only if you’re doing some adaptive content area (more for business apps and less for games) would you really need to worry about the size of the device.

Rob