Complicated question.

Hi everyone!

This is a complicated question: I need to know the millimeters or inches that are crossed by clicking and dragging on the screen. How I can do in cocos2dx (of course, multiplatform)?

Thx in advance!

Javier.

I’m not sure what’s the purpose… but try these…

[[http://forums.codeguru.com/showthread.php?t=351715]]

[[http://www.buzzle.com/articles/pixels-to-inches-conversion.html]]

[[http://www.thephotoforum.com/forum/digital-discussion-q/58309-pixels-inches-conversion.html]]

hope it helped…

Thanks, but these are the formulas for calculation. What I need is the data (screen’s dpi or ppi and physical resolution), for both iOS and Android.

Searching I’ve found for Android:

DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);

This:
xdpi
ydpi

Give me what I need, but… How can I call this java code from my c++ code?