Author Topic: problems when loading font-prefab assetbundle  (Read 4516 times)

xiewenqi.cs@gmail.com

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 12
    • View Profile
problems when loading font-prefab assetbundle
« on: September 25, 2012, 05:57:31 AM »
Hi everyone,

I'm a freshman in NGUI, and today i met a problem when working with UIFont, here is the situation.

First, I created a font-prefab using BmpFont and Font Atlas maker, created a Label widget (Label_A) using that font-prefab created before. I played the editor, everything went fine. Then I built that font-prefab and all it's dependencies into an assetbundle, using BuildOption.UnCompressedAssetBundle. I created a button, when clicking, unity loaded that assetbundle and got the font-prefab using www.assetbundle.mainAsset.getComponent<UIFont>(), assign it to a newly created UILabel widget (Label_B), the problem came here: Label_B shows very, very blurred string, which i guess was because the assetbundle's inner compression to my font atlas, but i have had supplied BuildOption.UnCompressedAssetBundle when building assetbundle.

please help me with this, thank you!

xiewenqi.cs@gmail.com

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: problems when loading font-prefab assetbundle
« Reply #1 on: September 25, 2012, 06:18:18 AM »
fixed up! I should have use BuildTarget.StandaloneWindows instead of BuildTarget.WebPlayer when built font-prefab assetbundle! :)