- Home /
Tutorials for 2D game GUI
I'm sure I'm not the first to notice that GUI's on Unity is a bit tricky.
I tried adding a simple pause menu to the PlaygroundProject tutorial after I was finished with it. But it gave me huge issues. It would not respond properly,
So that compels me to want to master this whole UI business in Unity. The problem is I'm not finding any friendly tutorials on it. It is usually part of some bigger project and way too specific.
I'd like to see some tutorial or documentation on everything there is to GUI. Start menus, pause menus, settings, anything else GUI related. Does anyone have a good guide for me?
Answer by dan_wipf · Aug 10, 2018 at 07:45 AM
hm alot of specific ui explenation are found in the docs of unity. tutorials i found some basics here:
https://noobtuts.com/unity/ui https://www.raywenderlich.com/795-introduction-to-unity-ui-part-1 creating a menu // https://unity3d.com/de/learn/tutorials/topics/user-interface-ui/creating-main-menu
Answer by madks13 · Aug 10, 2018 at 11:26 AM
First, you must understand that there are 2 GUIs. I still sometimes see the older one in screen shots.
If you are talking about the new one, using the canvas, the most important thing to understand is that the GUI are game objects. You can instantiate and use them pretty much the same way as other game objects. As for how they work, individually, your best source of infomration is Unity docs. Granted, the doc sometimes lacks usage examples for better understanding, but so far i've been running to it the most when i wanted to know how some unknown unity thing works.
The older GUI is more of painter thing. It adds GUI elements based on object properties. You can overload it to do a custom paint job too. But i recommend using the new version. In my opinion, even though it's bothersome for some specific things, like dynamicaly building a GUI at runtime with infinite sized lists, it's still better.