Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: xiewenqi.cs@gmail.com on September 25, 2012, 05:57:31 AM

Title: problems when loading font-prefab assetbundle
Post by: xiewenqi.cs@gmail.com 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!
Title: Re: problems when loading font-prefab assetbundle
Post by: xiewenqi.cs@gmail.com 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! :)