I am making a mobile game and want to detect roughly if the screen (window) size is closer to a phone or a tablet. Basically, if it's bigger or smaller than 8".
I'm reading the documentation for PlatformInfo, but can't make sense of it.
I found an old post where Ashley says it's possible to estimate screen size from CanvasCss Width and Height. But I tested on my phone and PC screen with the same resolution, and by changing display scaling settings, I get vastly different results.
- 6" mobile screen set to smallest scale: CssHeight=510, DevicePixelRatio=2.1
- 15.4" PC screen set to highest scale: CssHeight=618, DevicePixelRatio=1.75
So obviously this method doesn't work.
ChatGPT says I need one more piece of information: the PPI (pixels per inch) or DPI (dots per inch) of the screen. Without it it won't be possible to estimate the physical size.