When setting Tile Source at runtime, other tile maps already using the tile source need to be deleted before the change is visible. See below.
Is there a way to set the Tile Source without first deleting the other tile maps?
go.property("tile_source1", resource.tile_source("/main/1.tilesource"))
go.property("tile_source2", resource.tile_source("/main/2.tilesource"))
function init(self)
go.set( "/tilemap2#tilemap2", "tile_source", self.tile_source2 ) -- Does nothing until tile map 1 has been removed.
timer.delay(2, false, function()
go.delete("/tilemap1") -- Tile source of tile map 2 changes
end)
end
Those two tile maps always have to share the same tile source, even if different tile sources are set at runtime. I’m sure there is a technical reason for this. It looks like I’m going to need two sets of identical tile maps, with different tile sources set in the editor, rather than setting them at runtime.