- Home /
set a skin to "on" state programatically
Hi,
I would like to set the style of a gui component to "on" but I fail to find how I can achieve that by code. This is not a button or toggle, and I have to set it via code not via user input.
I looked at GUIStyle.Draw help section. It seems to give options to set the on state but I do not understand nor find examples on how to use this function.
Thanks for your input.
Bye,
Jean
I would love to see this answered. I would like to make ButtonB go to its "on normal" state when the mouse is over ButtonA.
Answer by v2k · Mar 21, 2011 at 05:29 PM
Looking for an answer to the same question...
Should have been a comment really... create an answer if you actually have the answer :)
Answer by GlennHeckman · May 27, 2011 at 05:23 AM
I've had the same issue in the past and I ended up writing a class customized to my needs with toggle buttons. However, depending on your end goal, the GUI.Toolbar might work out for you. Here's a link: GUI.Toolbar
Your answer
Follow this Question
Related Questions
GUIStyle component to be changed during script? 1 Answer
Is it possible to detect which GUIStyleState is used? 1 Answer
Can't modify custom class variables in the Inspector tab 1 Answer
What's the difference between Normal and OnNormal in GUIStyle 2 Answers
GUI Box with code defined GUIStyle does not show up... What am I doing wrong? 0 Answers