updated phaser to version 3.51 and fixed the BC

This commit is contained in:
kharhamel 2021-01-06 15:00:54 +01:00
parent 178af22280
commit 1359fbe977
8 changed files with 22 additions and 24 deletions

View file

@ -227,7 +227,7 @@ export abstract class Character extends Container {
}, 3000)
}
destroy(fromScene?: boolean): void {
destroy(): void {
if (this.scene) {
this.scene.events.removeListener('postupdate', this.postupdate.bind(this));
}
@ -236,7 +236,7 @@ export abstract class Character extends Container {
this.scene.sys.updateList.remove(sprite);
}
}
super.destroy(fromScene);
super.destroy();
this.playerName.destroy();
}
}

View file

@ -29,6 +29,7 @@ export class RemotePlayer extends Character {
this.playAnimation(position.direction, position.moving);
this.setX(position.x);
this.setY(position.y);
this.setDepth(position.y);
this.setDepth(position.y); //this is to make sure the perspective (player models closer the bottom of the screen will appear in front of models nearer the top of the screen).
}
}

View file

@ -52,7 +52,7 @@ export class SpeechBubble {
this.bubble.lineBetween(point2X, point2Y, point3X, point3Y);
this.bubble.lineBetween(point1X, point1Y, point3X, point3Y);
this.content = scene.add.text(0, 0, text, { fontFamily: 'Arial', fontSize: 20, color: '#000000', align: 'center', wordWrap: { width: bubbleWidth - (bubblePadding * 2) } });
this.content = scene.add.text(0, 0, text, { fontFamily: 'Arial', fontSize: '20', color: '#000000', align: 'center', wordWrap: { width: bubbleWidth - (bubblePadding * 2) } });
const bounds = this.content.getBounds();
this.content.setPosition(this.bubble.x + (bubbleWidth / 2) - (bounds.width / 2), this.bubble.y + (bubbleHeight / 2) - (bounds.height / 2));