x


Semitransparent GUI Buttons

Is it possible to have semitransparent GUI buttons (without using a alpha-semitransparent texture in gui style)?

more ▼

asked Jan 13 '11 at 02:33 AM

ina gravatar image

ina
3.3k 492 549 598

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

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;
more ▼

answered Jan 13 '11 at 02:40 AM

Mike 3 gravatar image

Mike 3
30.5k 10 65 253

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Apr 30 '11 at 06:10 AM

GlennHeckman gravatar image

GlennHeckman
335 7 10 19

(comments are locked)
10|3000 characters needed characters left

i need to make totally solid button

more ▼

answered Mar 05 '12 at 10:23 PM

augmented2012 gravatar image

augmented2012
1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3680
x786
x178
x111

asked: Jan 13 '11 at 02:33 AM

Seen: 3128 times

Last Updated: Mar 05 '12 at 10:23 PM