Author Topic: Need help w/ font colors  (Read 7053 times)

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Need help w/ font colors
« on: October 24, 2012, 05:20:43 PM »
For some reason, when I apply a color to a font used in a label (either by using the Color Tint selector or [FF0000] encoding), the encoding only shows up very faintly, as an outline color around the edge of the font. It's so faint that I wouldn't have even noticed without looking really, really closely.

The font itself otherwise works fine. It's readable in-game, the label works properly, everything's in a shared atlas, encoding is checked on the label, and so on.

The only issue is that color overlays don't work. Does anyone have any idea what I'm doing incorrectly?

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Need help w/ font colors
« Reply #1 on: October 24, 2012, 05:23:02 PM »
P.S. In case it matters, I created and exported the font from GlyphDesigner.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Need help w/ font colors
« Reply #2 on: October 24, 2012, 07:22:54 PM »
What color is the base font? If it's black, you aren't going to get any color tinting.

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Need help w/ font colors
« Reply #3 on: October 24, 2012, 07:30:20 PM »
Yeah, it was originally black. I tried changing it to white when exporting from GlyphDesigner, but couldn't seem to get it to import correctly (I'm guessing b/c it comes out as just a white square, which all gets stripped as alpha on import).

Is there a special trick for importing a white font?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Need help w/ font colors
« Reply #4 on: October 24, 2012, 11:21:32 PM »
No, the font is always white by default. Sounds like you didn't export it correctly. Try consulting the Glyph Designer manual if there is one, or asking on their support forums.

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Need help w/ font colors
« Reply #5 on: November 02, 2012, 04:26:19 PM »
Just wanted to follow up in case this helps anyone else. My problem was that I was exporting from GlyphDesigner with black text on a white background. To get font coloring to work the font needs to be white, as ArenMook said, but the important thing is that you set the background to be black. I was exporting white-on-white, which confused NGUI on import b/c there was no detail at all in the texture. If you export w/ a black background, NGUI is able to properly recognize the characters and thus do color tinting, etc.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Need help w/ font colors
« Reply #6 on: November 02, 2012, 04:30:03 PM »
NGUI doesn't recognize anything. Only what you save into the Alpha channel matters. I always have pure white in RGB, and only the Alpha channel contains the glyphs.

DrLoomis

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Need help w/ font colors
« Reply #7 on: November 02, 2012, 04:36:54 PM »
Sorry, maybe I used the wrong terminology. Maybe it's in how GlyphDesigner exports the data, as opposed to what NGUI recognizes, but all I meant was that exporting white-on-white resulted in a texture that, somewhere in the chain, was tagged as either all alpha or no alpha since there was no detail; it was just a white square.

Hell, maybe I'm still explaining it incorrectly, so the only thing that matters is this: when exporting from GlyphDesigner set your text color to white and the background to black. That works.