- Home /
What are the best practices in Unity to make a 2D menu interface?
I'm making an Android mobile application and cannot find the best practices as to how to lay out the user interface.
The aim is to have an efficient interface and also an easy to maintain unity project. Currently the approach is to use a game object to create the background and then have a game object used as a user interface folder with game objects representing the buttons inside using the OnGUI buttons.
Are there any example projects people would recommend?
I would recommend using NGUI or a similar product. I have only used NGUI. Especially on mobile, as it allows you to keep draw calls to a $$anonymous$$imum. other than than that. Having a $$anonymous$$enu Interface is best practice, then you can optimize that if need be.
"efficient interface and [...] easy to maintain" Traditionally these conflict. Then, easy to maintain depends on who's dong it (an intern who hand-aligns things in game view? Or a working BORDER_THIC$$anonymous$$_PX variable?)
Answer by MakeCodeNow · Feb 19, 2014 at 03:57 PM
Using the native Unity GUI works well for very simple interfaces, but will become very CPU heavy and hard to work with as your GUI gets more complex. I would avoid it unless you are creating Editor extensions.
Most game devs wind up just using regular GameObjects, and the new 2D Toolkit makes that even easier.
If you don't want to do all that yourself, there are also good options on the asset store. As others have said, NGUI is far and away the most popular and mature.
I'm currently using the Unity GUI features. I only have around 5-6 menu screens so think this should suffice? NGUI I considered however i'm looking for a free option as this is only for a project.
Answer by Dblfstr · Feb 19, 2014 at 04:47 PM
Depending on where the UI is located (In Game like health bar etc, or just a menu) There are different approaches.
For my menus, I created a menu scene. So I was able to use the default GUI and OnGUI(). Draw calls dint really matter there. And the UI will always scale to my screen size.
For In game stuff, I would either use gameobjects or sprites (ideally from a texture atlas)or buy a plugin like NGUI.
Answer by ReContraChanfle · Feb 23, 2014 at 12:36 AM
i am in the same problem, you have two options, use Gameobjects or GUI, i have tried with the 2, in my opinion, if the menu has simple functions like start game, load game or exit, use the GUI method.
Your answer
Follow this Question
Related Questions
Gamepad UI Controls: Always have the first button selected. 0 Answers
How do I properly make assets for mobile games 1 Answer
Making a blocker like dropdown menu for another gameobject. 0 Answers
UI behavior on resolution change 1 Answer
Getting a slider's width to match the size of the group it's in? 1 Answer