Update origin X and Y values in real-time

This commit is contained in:
2025-02-06 14:02:50 +01:00
parent 15b212160d
commit 7071d934b4
3 changed files with 24 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import { calculateIsometricDepth, loadMapObjectTextures, tileToWorldXY } from '@
import { MapObjectStorage } from '@/storage/storages'
import { useGameStore } from '@/stores/gameStore'
import { Image, useScene } from 'phavuer'
import { computed, onMounted, ref } from 'vue'
import { computed, onMounted, ref, watch } from 'vue'
import Tilemap = Phaser.Tilemaps.Tilemap
import TilemapLayer = Phaser.Tilemaps.TilemapLayer
@ -69,6 +69,13 @@ const imageProps = computed(() => ({
originY: mapObject.value!.originY
}))
watch(
() => mapEditor.refreshMapObject.value,
async () => {
await initialize()
}
)
onMounted(async () => {
await initialize()
})