I just did a test that might point to a way forward for you:
- I created an atlas with some images:
-
I set up a sprite to use one of these images as texture.
-
I dug out the texturec from the “build” folder
- I copied the texturec to a folder in the project, named it “test.texturec” and added the folder to the custom resources.
- Now I changed the atlas to contain different images, but the image sizes and order is intact:
- Running the game now shows the pink square:
- But with this little piece of code I can dynamically load and replace the texture resource on the sprite:
local buffer = resource.load("/res/test.texturec")
resource.set(go.get("#sprite", "texture0"), buffer)