- Home /
Whats best to use - OnGUI or inserting Texture objects
Im creating a small 2D game for 3-5 year olds. Like touching different pictures. Im wondering if its best to use OnGUI or just always create guiTextures in the hierarchy. I was going to be swapping which texture is visable when clicked and things like that (to show that one is highlighted).
I think I should use the second option as I can then tag them, and have events occur depending on what the child touches.
Also wondering if anyone knows where some good tutorials are for working with 2d textures and OnGUI scripting
Answer by Julien-Lynge · Sep 29, 2011 at 05:28 AM
My suggestion to you, since your primary goal here is buttons, would be to use OnGUI. This gives you access to the GUI.Button interface, and allows you a lot more customization. For instance, you could use a GUIStyle to setup all of your buttons, and change the look of every button with a single click.
In terms of tutorials, the Unity tutorial is a pretty good place to start - it has sample code that you can try out.
Your answer
Follow this Question
Related Questions
How to make OnGUI Texture able to be clicked 1 Answer
Long press on EXISTED GUITexture 1 Answer
GUI on iPhone...GUI.DrawTexture or guiTexture.pixelInset ? 1 Answer
GUI Problems 1 Answer