how to change texture color?

I set different text color on different state(normal, hover active) in GUIskin. but it doen’t seem to worked.

when I test it on the GUI.button, the text color is changed fine . but after setting background texture to NONE in GUIskin, the text color doen’t be changed.

is there anyway to change button text color when mouse is over it? but button should has no background image like lable…

thank you…

Have you tried setting the color directly in a GUIStyle and then using that style?

This should be entirely possible both by setting the Button information in a GUI skin (would apply to all buttons by default) or by setting a custom GUI Style and applying that to the buttons you want to have this behavior/color.

Can you share your exact settings? I ask that as it all works just fine here (ex: set the Hover state’s text color to red, when I roll over the button the text goes from white to red as expected).

Also, GUI questions should be posted in the UnityGUI area in particular, I’m moving this thread there now… :slight_smile:

Hi,

i just have the same problem. If i set the background to ‘none’ i get no hover state. I dont use a custom style. Here are my settings (all collapsed fields has default values):

void OnGUI ()
{
    GUI.skin = customSkin;
		
    if (GUILayout.Button("Start")) {
        Debug.Log("You clicked the button!");
    }
}

doesnt anyone else have trouble with this issue, doesnt anyone else tried it before or is there no solution for now? :slight_smile:

I also bumped into this.
My (obvious?) workaround was a transparent pixel texture as background.
Maybe not ideal in terms of performance but it works.

Same problem here: I don’t want a background image, but with the background set to None, the text hover color is ignored. (I’ll use a transparent image as a workaround. Good thought.)

EDIT: Same goes for Active state.

Is this intentional or a bug?