i want change color background button
the frist background color transparant and then after click this button change background color…
and than if click other button the background come back to transparant again…
Can you help me to problem solve???
Thank You…
Can you post your code so we can have a look and help you.
var myStyle2 : GUIStyle;
if (GUI.Button (Rect (45,112,45,20), " ALL |“,myStyle2))
{
GUI.Button (Rect (45,112,45,20), " ALL |”,myStyle2);
}
the style:
the normal color : whithe…
thank you
change the style???
or how??
you coud do something like this :
var style1:GUIStyle;
var style2:GUIStyle;
private var currentStyle:GUIStyle;
function Start () {
currentStyle = style1;
}
function OnGUI () {
GUILayout.BeginArea (Rect (200,200,100,25));
if (GUILayout.Button ("btn_1", currentStyle)) {
if (currentStyle == style1)
currentStyle = style2;
else
currentStyle = style1;
}
GUILayout.EndArea ();
}
this souce code run and no bag…
but if many button , i must make many style???
or no???
The problem is solve…
thanks you for appels…
hahaha…
no, you just need 2 styles, every button can use the style it wants.
you can even use more styles, just set the wanted style as the current style.
just remember that every button will need it’s own currentstyle variable.
ooooo…
it’s okai…
i only use 2 styles…
and problem is solve…
hahaha…
thx appels…