- Home /
button will change color if a mouse hovers it
Hi, i want to make my button to be to change its bg color when a mouse hovers it. Before a put a gui style on it, the hover is okay but after putting a a gui style, button doesnt seem to react when you hover the mouse on it. here is my code: if(showGUI == true)
{
GUI.Box(Rect(0,0,screenW/6,screenH/4),"");
if(GUI.Button(Rect(0,50,200,30),"START",myStyle))
{
DontDestroyOnLoad(GameObject.FindWithTag("TIGER"));
//levelCounter.level1=false;
load = true;
}
there is some options in the inspector that i can change the hover,normal and focused but it doesn work.. can you help me ?thanks } if(GUI.Button(Rect(0,80,200,30),"load",myStyle)){
if(saveLoad.showSaved==true){
saveLoad.showSaved=false;}
else if(saveLoad.showSaved==false){
saveLoad.showSaved=true;
} }
Your answer
Follow this Question
Related Questions
How to get a pop-up window floating next to a gameobject? 1 Answer
Make GUI elements disappear 3 Answers
OnMouseOver() OnMouseDown() button raycast help 1 Answer
Loading GUI in middle of mouse and make it work radial 1 Answer
GUI OnMouseEnter popup. text String is layering for multiple game objects? 1 Answer