unity3d - Android DisplayMetrics inconsistent between devices -
i'm trying use dpi , touch input in unity game recognise gestures consistently across android devices of different sizes. for instance, want virtual thumbstick 2 inches "full left" "full right". given dpi of screen, can convert touches pixels inches this: inchesfromstickcenter = pixelsfromstickcenter/dpi . to dpi, unity offers screen.dpi getting inconsistent results across devices. thumbstick way big, way small. instead went straight android's displaymetrics, xdpi , ydpi , , densitydpi . question difference between declared size in inches , size obtained using displaymetrics see densitydpi rounded value, , should using xdpi or ydpi. i tested things trying compute width of screen in inches (my landscape, these examples assume landscape). when divide screen pixel width (1280) xdpi (195.4) on 1st gen n7, overestimates screen width half inch (6.55 inches, compared under 6 when measured rule). when divide densitydpi (213), it's better answer. wiki...