Hi,
Does anyone know how to measure a line drawn in an app in inches.
I tried measuring DPI and converting pixels to inches however that system.info returns nill
Hi,
Does anyone know how to measure a line drawn in an app in inches.
I tried measuring DPI and converting pixels to inches however that system.info returns nill
On iOS there really isn’t a dpi function to get you the value. You would need to look up the various devices and have a table of known DPI values. Even on Android where we can get the DPI values, they are known to not always be accurate . But . . .
Measuring a line as a function of length in inches is meaningless for most Corona SDK based apps. If you’re using any scaling method other than “adaptive” in your config.lua (or leave the scale out completely) do the number of content points on the screen vary from device to device.
If you are using “letterbox” or “zoomEven”, your screen will have a virtual content grid that’s measured in points. On an iPhone 4 a 100 point line might be an inch on the screen, but on an iPad it’s going to be like three inches long.
Rob
On iOS there really isn’t a dpi function to get you the value. You would need to look up the various devices and have a table of known DPI values. Even on Android where we can get the DPI values, they are known to not always be accurate . But . . .
Measuring a line as a function of length in inches is meaningless for most Corona SDK based apps. If you’re using any scaling method other than “adaptive” in your config.lua (or leave the scale out completely) do the number of content points on the screen vary from device to device.
If you are using “letterbox” or “zoomEven”, your screen will have a virtual content grid that’s measured in points. On an iPhone 4 a 100 point line might be an inch on the screen, but on an iPad it’s going to be like three inches long.
Rob