Can you find out screen size in millimeters?

Hi. I wonder if it is possible to figure out how long 10 pixels are in screen size? For example to make a button that is always 40 millimeters in screen height independent of device?

This is your 500ths post. Congrats!

OnTopic: Maybe something with WIDTH or HEIGHT
I mean so everything is in pixels…, there is no way to specify text(string, 50mm, 50mm) will be marked as error.

Edit: May this could help

@tnlogy - Codea doesn’t provide this option, but you may have more luck with Xcode, so try a little googling

The only feasible way is to detect the device and then have a table of PPI (pixels per inch) values (from Google) and then work it out by hand.

I don’t think the devices are configured to return a PPI value but if they are then you could future proof your code by having the value for the current device returned - but as @Ignatz said it’s not something you could get from Codea.

Hmm - I wonder if there’s scope in Codea’s future to have a generic OS hook function that you could pass in a table with the function name and all the options, then it would then make the appropriate OS function call and return the values?

I guess I need to find a suitable mapping from the information provided calling deviceMetrics() to calculate the screen size. Thanks for the help!