How would it be possible to swap out an atlas at runtime

Yes, you can change the atlas. I’m guessing you are using sprite components? In that case the property is called “image”, and you can swap it out using go.set:

go.set("#sprite", "image", some_atlas_path)

You can use script properties to define a bunch of atlases you want to switch between as well:

-- these need to be specified at the top of your script:
go.property("skin_base", resource.atlas())
go.property("skin_xmas", resource.atlas())

function init(self)
    -- it's christmas!
    go.set("/go#sprite", "image", self.skin_xmas)
end
5 Likes