Android GUI elements are small.

I’ve been searching through the threads and there have been many people who have had this issue. Almost everyone tells them to use different font sizes, scales etc. While this is a great a solution, I can’t seem to figure out why the GUI is so small and how to detect what to scale it buy.

The Galaxy S3 screen size is something like 1080 x 1920, so respectively I put that as my player size in the editor. Everything looked great, until I released to my friends GS3 for a test. Even though the resolution is the same, the scale is way off. I’m assuming this might have something to do with DPI, however how can we detect this?

I don’t want to have to hardcode each scale for every android release (iPhone won’t be so bad, since theres only like 3 different screen types), so I need a way to determine what to scale by. Any help would be much appreciated.

I use NGUI which can automatically scale based on the camera’s height, so I don’t know how Unity handles scaling their UI.

I do know that you can use the Screen class to get the width, height, and dpi of the screen then manually adjust values if you have to. Again, I don’t use Unity’s UI system so I’m not sure what best practice is!

What do you mean based on the cameras height? Sorry this kind of confused me. I’m assuming you mean the pixels, but that wouldn’t make sense.

Sorry, camera height only really makes sense for orthographic cameras.

For NGUI, say I have a button who’s height is equal to 25% of the screen. NGUI will make sure it is always 25% of the screen height, no matter how many pixels high the screen is. The downside is that done this way, Pixel Perfect only happens if the device height matches whatever default we are working with. Otherwise the GUI image will be grown/shrunk to be 25% of the screen height.

If you really must have Pixel Perfect then you might need a couple of atlases with your GUI art in several different sizes. I’ve seen a couple of systems, NGUI included, where an atlas can be scaled to half automatically based on the device.

Again, I’m not sure what best practice is when using Unity’s GUI. I’m interested to see how other people handle this.