Livecode Wiki
Advertisement

Returns the device's screen resolution in pixelsSyntax:

iphoneDeviceResolution()

Examples:

put iphoneDeviceResolution() into tScreenResolution

Use the iphoneDeviceResolution function to find the resolution of the device's screen in pixels

The iphoneDeviceResolution function returns the resolution of the device's screen in pixels.

The new iPhone 4 has a display with double the resolution in both horizontal and vertical directions. By default, iOS handles this by mapping one logical 'point' to two physical 'pixels' with applications (LiveCode included) interpreting everything in terms of logical points. This means that apps targetted for older devices will run identically on the newer iPhone 4 devices.

The screenRect and associated properties all deal in logical points, they do not reflect the actual device resolution at which the app is being displayed. To fetch the device screen's resolution in pixels use the iphoneDeviceResolution function.

See also: iphoneDeviceScale (function),

Advertisement