- Home /
Texture's Alpha is not Transparent when I use it as a GUI.label
I have two textures that I have checked "Alpha is Transparent". When I put it on a regular cube and change the Shader to Transparent/Diffuse the alpha is transparent but I want too use it as a GUI.Label. The two textures are a .jpg of a walking person and a running person. I have a option to sprint and I want the label to switch from the walking image to the running image when sprinting. I have made this work but there is a white border around the image. They are both a 64 bit texture , "Alpha is Transparent" is checked, it is clamped, it is set to true color, and it is also set to point.
Answer by thornekey · Aug 05, 2014 at 12:45 AM
try something like this:
Whether you are using C# or JavaScript, it should be pretty similar. Ill do it in C# for you.
public Texture2D yourImage;
void OnGUI () {
GUI.color.a = 1.0;
GUI.Label (new Rect (1,1,128,32), yourImage);
GUI.color.a = 0.5;
}
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
GUI Texture Problem 3 Answers
Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer
GUI.DrawTexture and assign it to a variable? 1 Answer
GUITexture Button? 1 Answer