- Home /
apply GUI styles to GUIText
i've added some GUIText to a scene. and of course it's flat white. i've figured out how to change the size and font and in theory change the material, though i just want to change the color.
i looked at using GUISkins but as far as i can tell that's exclusivly for when you're creating the GUI elements with code.
is there a way to add GUIText to a scene and then have it use a GUISkin or some other store of styles?
all of the tutorials and examples i can find only cover code generated GUIs... is visually laying out an interface simply doing it the wrong way? and if so why am i even able to add un-skinnable GUIText objects to my scene?
this wouldn't be a problem if you could just set the font color for GUIText GameObjects. or if the materials actually worked ins$$anonymous$$d of turning into boxes. apparently GUI/TextShader is the wrong shader for gui text materials.
Answer by Eric5h5 · Jan 09, 2012 at 11:43 PM
GUIText/GUITexture was the original GUI system, before OnGUI code existed. Although GUIText does have the advantage of being able to use bitmap color fonts, rather than only TTF fonts. When you make a new material for GUIText, you also have to set the font as well as adding the font texture to the material...it's not enough just to apply the material, because it needs to know how to access the texture properly to create the letters, so it needs font information from the font as well as the texture. GUI/TextShader is correct.
how do i get unity to generate a font texture? (found out solid colors don't work) or do i need to find some other software that'll do that. :( i just want to change the font color... i don't care about super fancy styles. this is turning what should be a property you set into something more complex then most of the other elements i have in my scene.
also note: the select button in the inspector probably won't show the font texture in any usable way... so drag and drop it from the font.
Your answer
Follow this Question
Related Questions
GUI Text as a Button? 1 Answer
Style dynamically created GUI Text 0 Answers
GUItext works 1 of 3 situations? 0 Answers
Draw GuiText on 2d tile sprite Like 2048 game 0 Answers
Display GUI Text 1 Answer