- Home /
Check how many inch the user drags on the screen
Before I use Input.mousePosition to determine how far did the user drag on the screen. But for some features it is not reasonable.
For example, I need the user to drag for half of the screen on the iPhone to activate a feature, you won't ask the user to drag for half of the screen on iPad (suppose they have the same resolution, i.e. Input.mousePosition gives the same value).
Or iPad mini and iPad mini retina has the same device dimension and they have totally different resolution. I cannot depend on the value of Input.mousePosition.
So what can I use? Thanksf or advice.
Answer by fanling3 · Jul 17, 2014 at 03:35 AM
var widthInInches = Screen.width / Screen.dpi;
This is what I need, I guess
Answer by codestage · Jul 16, 2014 at 08:30 AM
You may use Screen.dpi to take into account the density of the pixels.
I think this parameter is sill not a perfect one. At lease iphone 5 has higher DPI then iPad2 but the screen of iPad2 is obviously larger
I didn't meant solo usage of Screen.dpi, you got me right looking at your example above.
Your answer
Follow this Question
Related Questions
Hey I would like to learn via script how to change automatically the screen orientation 1 Answer
Android/IOS GUI Rescale 0 Answers
PDF417 Barcode reader for iOS and Android 0 Answers
Mobile: Does using a banner ad make screen height smaller? 0 Answers
How to reset Screen.sleepTimeout to users SleepTimeout.SystemSetting? 0 Answers