1
0
forked from noxious/client

PlacedMapObjects.vue refactor for map

This commit is contained in:
2025-01-13 11:40:41 +01:00
parent 4d88917526
commit 5cf7423a5c
9 changed files with 33 additions and 21 deletions

View File

@ -1,5 +1,5 @@
<template>
<Image v-if="gameStore.isTextureLoaded(props.placedMapObject.mapObject)" v-bind="imageProps" />
<Image v-if="gameStore.isTextureLoaded(props.placedMapObject.mapObject.id)" v-bind="imageProps" />
</template>
<script setup lang="ts">
@ -8,7 +8,7 @@ import { loadTexture } from '@/composables/gameComposable'
import { calculateIsometricDepth, tileToWorldX, tileToWorldY } from '@/composables/mapComposable'
import { useGameStore } from '@/stores/gameStore'
import { Image, useScene } from 'phavuer'
import { computed } from 'vue'
import { computed, onMounted } from 'vue'
const props = defineProps<{
tilemap: Phaser.Tilemaps.Tilemap
@ -38,4 +38,8 @@ loadTexture(scene, {
} as TextureData).catch((error) => {
console.error('Error loading texture:', error)
})
onMounted(async () => {
})
</script>