- Home /
GUI materials
Is there a way to render a GUI texture with a specific material?
I want to grey out menu buttons programatically.
Answer by DaveA · Aug 27, 2011 at 06:55 AM
Look into GUIStyles, I think that's what they're for. That said, I've not tried using them to gray GUI textures.
Answer by sharsnik · Aug 27, 2011 at 11:07 AM
From what I can tell of the documentations, there doesn't seem to be any material settings in GUIStyle... which I guess kinda makes sense, because the Box renderer is probably using a special shader to draw the border. Still.. I'd like to be able to override that :/
I doubt it's a very special shader. Bordered textures like that can be rendered just by having a 4x4 vertex planar mesh, with the UVs positioned according to the border etc. The shader itself doesn't need to know why the mesh has such values, it just does normal rendering. But yes, I'm interested in the answer too.