npm update, npm run format
This commit is contained in:
@ -56,23 +56,21 @@ onPreUpdate(() => {
|
||||
orderedImages.forEach((child, index) => {
|
||||
const image = child as Phaser.GameObjects.Image
|
||||
if (image && props.obj) {
|
||||
image.flipX = props.obj.isRotated;
|
||||
image.flipX = props.obj.isRotated
|
||||
|
||||
if (props.obj.isRotated) {
|
||||
var offsetNum = props.mapObj!.depthOffsets.length
|
||||
|
||||
//Could break in case of images with odd partion number
|
||||
//Shifts image over so that it becomes aligned again after flipping
|
||||
if (index < offsetNum/2) {
|
||||
image.x = props.x! - (props.mapObj!.frameWidth/offsetNum)
|
||||
}
|
||||
else {
|
||||
image.x = props.x! + (props.mapObj!.frameWidth/offsetNum)
|
||||
if (index < offsetNum / 2) {
|
||||
image.x = props.x! - props.mapObj!.frameWidth / offsetNum
|
||||
} else {
|
||||
image.x = props.x! + props.mapObj!.frameWidth / offsetNum
|
||||
}
|
||||
|
||||
image.setDepth(baseDepth - props.mapObj!.depthOffsets[index])
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
image.x = props.x!
|
||||
image.setDepth(baseDepth + props.mapObj!.depthOffsets[index])
|
||||
}
|
||||
@ -80,7 +78,6 @@ onPreUpdate(() => {
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Initial setup
|
||||
if (props.mapObj && props.x && props.y) {
|
||||
baseDepth = calculateIsometricDepth(props.obj!.positionX, props.obj!.positionY)
|
||||
@ -88,13 +85,13 @@ if (props.mapObj && props.x && props.y) {
|
||||
group.setXY(props.x, props.y)
|
||||
group.setOrigin(props.mapObj.originX, props.mapObj.originY)
|
||||
|
||||
let sliceCount = props.mapObj.depthOffsets.length;
|
||||
let sliceCount = props.mapObj.depthOffsets.length
|
||||
for (let j = 1; j <= sliceCount; j++) {
|
||||
partitionPoints.push(j * (props.mapObj.frameWidth/sliceCount))
|
||||
partitionPoints.push(j * (props.mapObj.frameWidth / sliceCount))
|
||||
}
|
||||
|
||||
for (let i = 0; i < partitionPoints.length - 1; i++) {
|
||||
createImagePartition(partitionPoints[i], partitionPoints[i+1], props.mapObj.depthOffsets[i])
|
||||
createImagePartition(partitionPoints[i], partitionPoints[i + 1], props.mapObj.depthOffsets[i])
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user