Custom Styles Problem

We have GUI skin that has transparent buttons, I wanted to have some buttons with a different Style.

I created a style separate from the skin and applied all necessary rules for it. When I apply this style to the buttons I want they display correctly.

I wanted to integrate this style to the skin for organization purposes so I created it under CustomStyles for the skin and applied it to the buttons using skinname.customStyles[0].

The customStyle in the skin has all its attributes identical to the external custom style I created. The buttons do not display the text when the customStyle from the skin is applied, all other attributes display correctly, only the text is missing.

The external style works fine this only happens with the skin customStyle

Any help with this would be very appreciated.

I’m encountering the exact same problem. If you use a style from customStyles text will not be displayed. If the style is defined as a variable in a script it works fine. Has this been bugged? Is going to be fixed? The original post was from January.

Also encountered an issue using BeginScrollView which takes the max number of arguments. Some internal function that it calls is adding another null GUIStyle argument which causes an exception, making that function useless.

There’s also a bug with using fixed sized thumbs in scrollviews. I worked around by setting margins, but it’s only working when the thumb would be scaled down, when it’s scaled up I can’t seem to figure it out, you have to put in some crazy large values for the margins when the view size is close to the content size.

Overall I’ve been happy with Unity but I’m constantly fighting the UI API to do exactly what our UI designers want.

I also posted a bug with RenderTextures on Windows which I haven’t gotten any response to.

Are you sure that text color for every state (normal, hover, active etc) is set to color other than black?

I’m having the same issue of rickb235, have passed 5 years but still can’t get text showed up with a custom style inside my custom skin.

Like KaelisAsur wrote, when you create a custom style, the colors for the states (normal, hover, etc.) start at R=0, G=0, B=0, Alpha=0. When Alpha is 0, the text is invisible. Try changing Alpha to 255.

Oh my… I was writing my whole code until I saw Tony’s answer. I feel stupid now, why didn’t check that. I’ve spend 4 hours giving around this issue. Do that color comes by default for custom styles, I mean 0 value for Alpha, I don’t remember touching that.

Now I see, this was driving me to madness, I wrote the code in 100 different ways… Thank you very much guys.

Happy to help! Yes, by default alpha is 0.