- Home /
Android Resolution Solution ?
Hey all,
I'm getting started with Unity and Android, and wanted to get the resolution/aspect ratio issue sorted out before I sit down and try to make a very simple game from start to finish. I've been doing a lot of reading on the topic, but unfortunately I really don't know what to do to try to remedy it.
What I'm having trouble with is figuring the dimensions of the playable area based on how big the screen is. With this information in hand I would then be able to restrict enemy and player movement, as well as alter other game logic.
I'm currently developing with my Samsung Galaxy Nexus (ICS, Android 4.0.2), but would of course like the game to function both on my wife's Droid 2 and my spare HTC Incredible. How can I do this? D:
No thoughts? Hrm.
Will purchasing a 3rd-party package like NGUI help? :|
@the1nk it really shouldnt matter in coding, other than the actual rendering of the GUI. The cam picks up what it does based on the view spectrum. If you know the specific res you are going for, you can create the gui items for that spec (or you can go the more dynamic route and code in 'spacers' for the "fill" sections of your gui). You may have x amount of space, with n amount of spacer value and fill in the space value with a standard element that align with the corresponding gui. Not very east to write, but it is pretty advanced in itself..
@yusufulutas - Why? Does it offer advantages over NGUI for my concern -- creating the GUI on multiple android devices which sport many different resolutions and aspect ratios?
@hijinxbassist - Yeah, I'm typically concerned with the GUI itself. As far as I can tell, the Camera will just need to keep important elements centered on the screen so that as the aspect-ratio/resolution changes, nothing too big will be missed. The GUI is the nightmarish part, though, as ins$$anonymous$$d of having it just work
I'd prefer it to look good
:P
@The1nk yeah it's supports for multiple android devices and it has very good documentation. http://www.anbsoft.com/middleware/ezgui/
Answer by dylan92 · Jul 11, 2013 at 06:52 PM
The best solution would be for you to write something that allows you to design your GUI for a common aspect ratio and then just scale the resolution based on the device. Alternatively, you could just buy one of the many GUI solutions on the Asset Store.
I recommend GUI Essentials. It's very easy to use and has a low cost compared to other GUI solutions.