Author Topic: UIAtlasMaker public API  (Read 4037 times)

ryan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 90
    • View Profile
UIAtlasMaker public API
« on: November 12, 2013, 06:16:29 PM »
Would you mind exposing more of the atlas maker's functionality?  I'm trying to automate updating all of the sprites in an atlas from a directory containing the textures, and it's really slow doing it one at a time, and I can't remove sprites with what's currently public.  I'm looking for something along these lines:

  1.         public static void UpdateAtlas(UIAtlas atlas, List<Texture> textures, bool keepSprites)
  2.         {
  3.                 if (atlas != null && textures != null)
  4.                 {
  5.                         List<SpriteEntry> sprites = CreateSprites(textures);
  6.                         ExtractSprites(atlas, sprites);
  7.                         if (!keepSprites)
  8.                         {
  9.                                 sprites.RemoveAll((se) => (textures.Find((t) => t.name == se.name) == null));
  10.                         }
  11.                         UpdateAtlas(atlas, sprites);
  12.                 }
  13.         }
  14.  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker public API
« Reply #1 on: November 13, 2013, 08:04:39 PM »
Sure, I'll make it public.