Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17083

Best practice for referencing SpriteFrames in AutoAtlas?

$
0
0

I have a group of Sprites that will be compiled into an Auto Atlas at build, and I have placed a reference to the .pac file in my code. I would like to reference the each sprite individually though, for example: atlas.getSpriteFrames()[1]

AutoAtlas offers a .getSpriteFrames(), but because atlases are not built during preview, it turns up empty.

What is the best practice for retrieving a SpriteFrame from an AutoAtlas that is able to run under preview mode?

Should I ignore the AutoAtlas and

  1. use loader/loadRes to load the sprites individually?
    OR
  2. set up an array of SpriteFrames and populate with references to individual sprites?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 17083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>