- Home /
Question by
ina · Jan 13, 2011 at 02:33 AM ·
guibuttontransparentguistyle
Semitransparent GUI Buttons
Is it possible to have semitransparent GUI buttons (without using a alpha-semitransparent texture in gui style)?
Comment
Best Answer
Answer by Mike 3 · Jan 13, 2011 at 02:40 AM
Modify GUI.color before the button call, then set it back to Color.white after (or else all the rest of the gui will do it too)
GUI.color = new Color(1,1,1,0.5); //0.5f in c#
GUI.Button(new Rect(50, 50, 200, 50), "Semi Transparent");
GUI.color = Color.white;
Answer by GlennHeckman · Apr 30, 2011 at 06:10 AM
GUI.color.a = someFloatValueBetween_0_and_1
This will directly control the alpha of anything after this line.
Be sure to set the GUI.color.a back to 1 so the remaining GUI Elements aren't dimmed as well.
Your answer
Follow this Question
Related Questions
Change Button GUIStyle on Click 1 Answer
Detect Click on Gameobject 0 Answers
Change GUI.Box color when click button 1 Answer
Unable to find style in skin repaint 1 Answer
How to customize guistyle 0 Answers