forked from noxious/client
Moved component attributes to properties function for more streamlined experience
This commit is contained in:
parent
32dc7a2963
commit
245b50c1fd
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Image v-for="object in zoneStore.zone?.zoneObjects" :depth="calculateIsometricDepth(object.positionX, object.positionY, object.object.frameWidth, object.object.frameHeight)" :key="object.id" v-bind="getObjectImageProps(object)" :flipX="object.isRotated" />
|
<Image v-for="object in zoneStore.zone?.zoneObjects" :key="object.id" v-bind="getObjectImageProps(object)" />
|
||||||
<!-- <Text v-for="object in zoneStore.zone?.zoneObjects" :key="object.id" :depth="99999" :text="Math.ceil(calculateIsometricDepth(object.positionX, object.positionY, object.object.frameWidth, object.object.frameHeight))" v-bind="getObjectProps(object)" />-->
|
<!-- <Text v-for="object in zoneStore.zone?.zoneObjects" :key="object.id" :depth="99999" :text="Math.ceil(calculateIsometricDepth(object.positionX, object.positionY, object.object.frameWidth, object.object.frameHeight))" v-bind="getObjectProps(object)" />-->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -26,8 +26,10 @@ const getObjectProps = (object: ZoneObject) => {
|
|||||||
|
|
||||||
const getObjectImageProps = (object: ZoneObject) => {
|
const getObjectImageProps = (object: ZoneObject) => {
|
||||||
return {
|
return {
|
||||||
|
depth: calculateIsometricDepth(object.positionX, object.positionY, object.object.frameWidth, object.object.frameHeight),
|
||||||
x: tileToWorldX(props.tilemap as any, object.positionX, object.positionY),
|
x: tileToWorldX(props.tilemap as any, object.positionX, object.positionY),
|
||||||
y: tileToWorldY(props.tilemap as any, object.positionX, object.positionY),
|
y: tileToWorldY(props.tilemap as any, object.positionX, object.positionY),
|
||||||
|
flipX: object.isRotated,
|
||||||
texture: object.object.id,
|
texture: object.object.id,
|
||||||
originY: Number(object.object.originX),
|
originY: Number(object.object.originX),
|
||||||
originX: Number(object.object.originY)
|
originX: Number(object.object.originY)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user