Do I need to only worry about the 3:2 and 16:10 aspect ratios?
I have come from iOS where I am used to 4:3 with the ipad (i tend to make for that and scale the interfaces for the other iOS devices to fit). I am now porting over to android so I want to make sure everything works great.
I am unsure since I have just started with Android myself, and I only have one Android device, but from other sources of information I think usung Screen.SetResolution will set it for all screens, however, not all Android devices have the same physical size pixel… So really I think its just trial and error from what I’ve gathered.
The resolutions I’m supporting for Android so far are:
1280 x 720 (Samsung S3)
1280 x 800 (Nexus 7)
1794 x 1080 (Sony Xperia Z)
and the top 2 are the most popular based on my Google Analytics page. I hope that helps!
Android has no aspect ratio limits. And since some devices have physical buttons and others don’t, the list of aspect ratios is quite a large one.
Nexus 7 has usable resolution of 1280x736 in landscape mode since the bottom bar (with back, home, etc buttons) is visible.
Nice 007! I don’t have one, but I’ll correct that.
I would just program it to where it works right no matter the resolution/aspect ratio. Just either force it to only landscape or only portrait, and use a scaling system for things like the gui.
For example, Build all your gui scripts with an xscale and a y scale, and say if you make it for 1280x720, you can get the scale by doing a screen.width/1280 and a screen.height/720. That gives you the scale to work with.
float xScale = Screen.width/1280;
float yScale = Screen.height/720;
GUI.Label(new Rect(0,0,200xScale, 100yScale), “My test label!”);
As far as 3d aspect, that’s a little harder, but it’s been talked about on the web before. Auto Scale camera depending on Screen Size - How?? - Questions & Answers - Unity Discussions
Take a look at the Unity Stats. There you can see which aspects and resolution are most popular.
But keep in mind that smartphones and tablets can have the same resolution/aspect. So physical size of button etc can be very different.
If you want to preview your game at various resolutions in the editor you can use the editor extension xARM I’ve created.
With xARM you can also preview your game at physical size (device dimensions).