Chant font color Unity 3??

Ok perhaps I just became dumber between Unity 2.6 and Unity 3, but I cannot figure out how to change the font color through the inspector…I could do this in unity 2.6. Any ideas?

If you open the font’s disclosure triangle in the project view, you will see the font material. The material has a colour you can set in the inspector.

This is something I wanted to do in Unity iPhone 1.7, and now Unity 3 beta, but the Font Texture and Text Color are greyed out and cannot be altered. I thought this was normal as it is the same across several different fonts. You post says this is not the case. Have I done something to disable this ability? Maybe the original poster has done the same.

I would love to be able to do this in the Inspector to save me from doing it in scripting.

It’s always been broken for me. Quite annoying!

I’ve looked around and it seems we should be able to change the font colour in the Inspector, but there are at least 3 of us who cannot, so I have submitted a bug report, Case 371938.

you can change them, just drop in an own font

I’ve seen this in some cases especially with the default font and the ones from the asset bundles but never with ones I’ve thrown in, be it U3 or iPhone 1.7

This is happening with fonts I have added.

font type you imported? (best file bug reports if you have a reproducable case)

I haven’t been able to change the color with any fonts I’ve imported.

They are all .ttf which I believe is the only kind allowable. I added several system fonts to the project attached to my bug report to show it wasn’t a problem with just the font I was using. It happens with Arial, AppleGothic, fonts from dafont.com, everything.

I checked the font page of the Unity documentation which states I should be able to change the colour. I have followed everything there.

it eats dfont too on osx and does not seem to have a problem with the color there

but generally I’ve more or less never seen problems with changing the shader and/or color

I’m also using OS X. I cannot pinpoint anything that I think might be causing it. I hope UT have better luck and they can live up to the standard set by very fast solutions for my previous 2 bug reports (not trying to put any pressure on, just saying I’ve been happy with the previous responses).

var TextColor : Color = Color.white;

function Start () { 
   guiText.material.color = TextColor; 
}

Enjoy.

No! :o

I’m having the same issue. The text color property seems to be grayed out and doing it it code doesn’t seem to do anything. It looks like the whole material is actually grayed out, not just the text color.

What I did to fix it was to create a new material using the same shader and assign it to the text mesh. You can then modify the property of the new material

Thank you. That works in simple circumstances, but is a problem if the font on an object is changed, something I do to my GUI Text to make it appear the same size on an iPhone 4 screen compared to earlier generations (same font, but a version at twice the size).

How is that a problem?

  1. It should make no difference.
  2. Don’t change the font. Just use quality settings. Otherwise you’re having two resolutions of the same texture in the app.

I thought quality settings were not used on the iPhone?

Can you give a more detailed explanation what you are saying please?

Changed for Unity 3.

What exactly do you want to know?

The things that go into GUI Text or a Text Mesh are an alpha texture that contains the glyphs, a UV set that is generated when you import the font, and a material that uses a shader that alpha blends a solid color. So creating your own material, and using that, as long as it uses the Font shader, makes zero difference.

As for the texture, you can alter it with something like this. I use a variant of that:

366377–12717–$savefonttexture_401.cs (840 Bytes)

Thank you, now that I know quality settings are used on iPhone. How do they work on the iPhone? And how do I use that to get a GUI Text to appear the same size on an iPhone 4 as they do on previous generations?