|
Trying to get a script working for GUI where's the GUI texture will change when I've hover'd over it etc, just wondering how'd I'd go about doing that? Not to sure if I'd use OnGUI() or OnMouseEnter etc. I'm using C# Thanks if you can help!
(comments are locked)
|
|
Update; This is what I'm using to test, I've got some other scripts setup etc, but thats irrelevant, what I want to know is how to change a texture to another texture when the mouse is over it. This is what I tried, which gives no errors but doesn't work.
(comments are locked)
|

Depends. How does your current GUI work? There are ways of making this happen for any method, really, but I'd like to know your specifics before I can tell you one of them. If it's just UnityGUI (as goes inside of OnGUI) I'd use a custom GUIStyle which had a different texture for 'hover' in the background.
At the moment, I don't have anything for the GUI. I have a image without a blur at the back and one that makes it shine for when it is hovered, I just don't know the script on how to change textures.
Well, just use OnGUI for that stuff. All the functionality is pretty much there for you already! It's not a script exactly, you define a custom GUIStyle in your script at the top, like
then set it all up in the inspector (including dragging images in from the Project window).