I have a label field which I use as a background for my GUI. When I put another label with a texture (an icon) on top of it, it darkens the icon substantially. Ive tried changing to order in which they are called, but the answer doesnt seem to be that easy.
Any answers?
I’m not quite sure what you mean - could you post a screenshot and a code snippet?
var goldTexture : Texture2D;
var pointTexture : Texture2D;
var livesTexture : Texture2D;
var goldAmount: int = 0;
var pointAmount : int = 0;
var livesAmount : int = 50;
var level : int = 0;
function OnGUI(){
//bottom background box
GUI.Label(Rect(0,Screen.height-40,32,32), goldTexture);
GUI.Box(Rect(0,Screen.height-80,800,80),"Option Bar");
//make the first button, this will advance the game
if (GUI.Button(Rect(0,Screen.height-80, 125,30),"Next Advance")){
level++;
if(level == 1){
gameObject.SendMessage("Level1");
}
}
}
attached is a picture
look at the icon on the inspector then look at it in the game view, it is darkened as if it is behind the Option Bar.
Ahh - I see (I think ;). Think of the GUI stuff as drawing commands.
AFAICS, you draw your goldtexture, then draw your box on top. Try inverting the order in code.
I was positive that Id tried that, but alas! Thank you. Works good now.