Author Topic: NGUI, BMfont & scale  (Read 5699 times)

nkls

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 29
    • View Profile
NGUI, BMfont & scale
« on: January 03, 2013, 12:50:22 PM »
Hi all!
Not sure if this is a NGUI or a bmFont-question, but I hope somebody is able to help me.

I have 3 different atlases, one SD (512x512), one HD (1024x1024) and one SHD (2048,2048).
Im using my reference-atlas to switch between them, and this works great for the sprites.

My problem is my fonts. They are on my atlas, and when I made them in bmFont i used the SHD resolution.
I use unitys importer to make the smaller SD & HD copy of my atlas texture (by setting max size).

My fonts works on the SHD atlas, since the font textfile is made from that size.
But when i switch to the HD or SD version unity tries to read from the same area on the atlas as on the SHD, which causes a mess.

Is it any way to make the font to use texture coordinates instead of pixel values? as the sprites on the atlas does? Or how do you guys solve this?

Thanks again for support!




Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI, BMfont & scale
« Reply #1 on: January 03, 2013, 03:05:17 PM »
I've generally put fonts in their own atlas with all fonts in, so I have one Arial10 font, one Arial20 font and one Arial40 font for the different sizes. And then use a reference font, the same way you use a reference atlas.

nkls

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: NGUI, BMfont & scale
« Reply #2 on: January 03, 2013, 03:44:37 PM »
thanks for answering! problem is, Im having 5 or 6 different fonts, and some of them are quite big. Dont want to load the high def fonts on the SD devices...
I could solve this by exporting the fonts in different sizes from bm font, but this forces me to rebuild the atlas manually for each of the three different resolutions... would have been very handy to to be able to just use the unity import..