Are there guidelines for when you should be using OnGUI() vs GUIText/GUITextures to lay things out?
Does one approach have advantages/disadvantages over the other?
I’m often confused as to which approach to use. Any help would be appreciated.
Are there guidelines for when you should be using OnGUI() vs GUIText/GUITextures to lay things out?
Does one approach have advantages/disadvantages over the other?
I’m often confused as to which approach to use. Any help would be appreciated.
GUIText/GUITextures are good for simple GUI uses that are typically in-game and non-interactive, like displaying number of lives left, ammo count, etc. They don’t need to be re-computed every frame like OnGUI, and also are simple to make resolution-independent.
OnGUI is better for menu screens and other, more complex uses where there’s a reasonable amount of interaction. GUIText/Texture quickly become unwieldy and cumbersome if used for anything more than simple stuff.
However neither is always ideal; there are 3rd-party GUI systems that can be faster and simpler than either, depending on what you’re doing.
–Eric
Thanks for the info Eric. Very helpful.