How to set atlas property from factory?

Interesting problem! If you have hundreds of them you don’t want to use go.property("my_atlas", resource.atlas("/atlas.atlas")) since all of them will be in memory at once.

What I would do is to per atlas create one dummy game object file with a sprite which references the atlas. Each dummy game object is referenced from a factory with the Load Dynamically checkbox set.

When you want to use an atlas you load the resources used by the correct factory using factory.load(). This will load the atlas into memory after which you can set it on your game objects.

1 Like