|
I have a script that writes some text OnGUI(). My other OnGUI() scripts seem to work fine, but this one seems to look horrible even though it's the same writing technique.
A) What I see against a black background B) What I see against a grey background C) It should be White (255,255,255,255). All of my other screen elements are bright white and they show up as such. Any help would be appreciated. Jason
(comments are locked)
|
|
If it's caused by someone else fading your color, and you can't fix that, a hack is to use super-white -- an RGB of 512. You can't do that in the color-picker, but you can do it in code (well, usually.) The code uses 0-1 for the channels ( That definitely fixes it. I noticed I can either "super-white" it or I can "super opaque" it as well (1,1,1,2) to fix it. The one catch is that it gives the color an inconsistently bright light. I'm glad to know why, but I'll look for something a bit more consistent in result. Thanks for the help!
Mar 03 '12 at 09:17 PM
Lethil
(comments are locked)
|
|
Wow, um... so... yeah... it turns out the reason that I was having issues was that 2 gameobjects had the OnGUI() draw script. I removed one of the dupes and it works like a charm now. After having no end of trouble with turning on/off multiple menus in multiple scripts, I've resolved to only ever use one big OnGUI, with functions/flags everyone has to talk to.
Mar 04 '12 at 04:10 AM
Owen Reynolds
(comments are locked)
|


Try a new font maybe? Look into GUI skins... file:///Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/GUISkin.html
I've tried the handful of fonts and they all end up this way. Moreover, this is the only OnGUI() call that seems to cause this. The other 4 calls on this screen work correctly (showing white text).
Is there any way you'd be able to share the OnGUI code where this is being called, or other aspects of the project that might help get to the root of the problem?
The color may be caused if you have set the font material color to be black; in which case even if the GUISkin is set to white, the white -or unaltered -version of black is still going to be black.
Absolutely: