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
Minimal example: SetTileSource.zip (26.4 KB)