Author Topic: Adding "TP Import" to UIAtlas Programatically  (Read 1856 times)

aikitect

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 27
    • View Profile
Adding "TP Import" to UIAtlas Programatically
« on: August 26, 2013, 10:41:04 PM »
Hello,

I was looking through the UIAtlas documentation and I couldn't figure out anything about how to assign a TexturePacker text file to a UIAtlas programmatically.  In the editor, I see the option for "TP Import", but there in the documentation there is no reference of this at all.

How would I be able to generate a UIAtlas using a TexturePacker-generated atlas then?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Adding "TP Import" to UIAtlas Programatically
« Reply #1 on: August 27, 2013, 02:27:54 AM »
Search for "TP Import" and look what happens: NGUIJson.LoadSpriteData.

aikitect

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 27
    • View Profile
Re: Adding "TP Import" to UIAtlas Programatically
« Reply #2 on: August 27, 2013, 03:01:54 PM »
Does NGUIJson have some sort of namespace I can't see?  I put in:

  1. NGUIJson.LoadSpriteData(foodIconAtlas, txtRequest.asset as TextAsset);

It gives me a NGUIJson does not exist in the current context.