Several map editor improvements
This commit is contained in:
@ -191,7 +191,19 @@ onMounted(() => {
|
||||
if (!zoneEditorStore.zone?.tiles) {
|
||||
return
|
||||
}
|
||||
setLayerTiles(tileMap, tileLayer, zoneEditorStore.zone.tiles)
|
||||
|
||||
// First fill the entire map with blank tiles
|
||||
const blankTiles = createTileArray(tileMap.width, tileMap.height, 'blank_tile')
|
||||
|
||||
// Then overlay the zone tiles on top
|
||||
const zoneTiles = zoneEditorStore.zone.tiles
|
||||
for (let y = 0; y < zoneTiles.length; y++) {
|
||||
for (let x = 0; x < zoneTiles[y].length; x++) {
|
||||
blankTiles[y][x] = zoneTiles[y][x]
|
||||
}
|
||||
}
|
||||
|
||||
setLayerTiles(tileMap, tileLayer, blankTiles)
|
||||
|
||||
scene.input.on(Phaser.Input.Events.POINTER_MOVE, pencil)
|
||||
scene.input.on(Phaser.Input.Events.POINTER_MOVE, eraser)
|
||||
|
Reference in New Issue
Block a user