Author Topic: Atlas maker error  (Read 4709 times)

jdwieber

  • Guest
Atlas maker error
« on: June 14, 2012, 01:42:23 PM »
Hello,
I just bought NGUI and began using it in a project to replace UIToolkit.  I currently use Texture Packer and decided to give the atlas maker tool a try.  I selected a bunch of textures and added them and got hit with a slew of warnings.  I pasted one below.  If I want to use my Texture Packer atlases, what data format should I use?  I currently use json as that is what UIToolkit requires.  Thanks.

  1. ImportSettings 'Assets/UIElements/DeutschGothicStrokeGradient.png' has been modified but AssetDatabase.ImportAsset has not been called. Please fix the scripts code or Import the asset manually.
  2. UnityEditor.AssetDatabase:ImportAsset(String, ImportAssetOptions)
  3. NGUIEditorTools:MakeTextureReadable(String, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:548)
  4. NGUIEditorTools:ImportTexture(String, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:595)
  5. NGUIEditorTools:ImportTexture(Texture, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:611)
  6. UIAtlasMaker:CreateSprites(List`1) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:197)
  7. UIAtlasMaker:UpdateAtlas(List`1, Boolean) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:516)
  8. UIAtlasMaker:OnGUI() (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:783)
  9. UnityEditor.DockArea:OnGUI()

PhilipC

  • Guest
Re: Atlas maker error
« Reply #1 on: June 14, 2012, 02:40:48 PM »
This i believe is a bug in Unity you have to hit save between each modification.

mdeletrain

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 71
    • View Profile
Re: Atlas maker error
« Reply #2 on: June 14, 2012, 04:54:08 PM »
If I want to use my Texture Packer atlases, what data format should I use?

TexturePackerPro as a Unity3D data format. It works just fine as far as the import step is concerned, but It gives me some trouble with fonts showing thin dark edges.

jdwieber

  • Guest
Re: Atlas maker error
« Reply #3 on: June 14, 2012, 06:57:46 PM »
Thanks for the replies.  I thought I saw a thread on how to put fonts into the atlas with the other ui elements, but I can't seem to find it now.  I made an atlas that has my ui elements and a font, using TP. When I create a label add type some text I see just a few black boxes. How do I tell NGUI that the texture provided is an atlas?  I created a UIFont with the font maker tool provided, used my atlas as the font texture, and assigned the renamed .fnt file as the font data.   I don't see a separate setting to tell NGUI that it's pulling data from an atlas, or a place to provide the atlas data to the font.  The font was made with bmGlyph and has been used successfully with UIToolkit. I attached a screen shot.

EDIT:

I figured it out.  It was a mix of stupidity and error.  I set up texture packer and bmGlyph to auto create SD and HD textures.  I gave TP the HD font, but gave ngui the .fnt file for the SD font texture.  The second error was in the UIFont script.  I didn't see the "Sprite" selection drop down to select which sprite the font data applied to.  Problem solved (PEBKAC).  However, for whatever reason, I was missing pieces of some letters and other letters entirely.  I had to import the font file multiple time before it showed up correctly.  It looks good now though.  I hope I don't have to modify it at all.  Bit of a finicky system, but well worth the money.

EDIT2:

Just a note for other newcomers that want to use TP.  Don't add the font into the atlas via TP as the font creation tool will add a copy of whatever texture you give it.  I wound up with a huge atlas comprised of my original atlas with the font, and another copy of my entire atlas placed inside.  Leave the font texture out and let NGUI add it.


Regards
« Last Edit: June 14, 2012, 09:53:12 PM by jdwieber »

JeanLuc

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Atlas maker error
« Reply #4 on: May 15, 2014, 09:40:14 AM »
Thanks, jdwieber, your remarks in "EDIT2" really helped me.