From: Ruben Rodriguez Date: Wed, 10 Mar 2021 21:38:43 +0000 (-0500) Subject: Tile-triggered text bubbles X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=018ab016b961ca398782053122fd22962be51b97;p=libreadventure.git Tile-triggered text bubbles --- diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 2b553a4..ea8edd5 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -435,9 +435,11 @@ export class GameScene extends Phaser.Scene { // debug code to get a tile properties by clicking on it this.input.on("pointerdown", (pointer: Phaser.Input.Pointer)=>{ //pixel position toz tile position - let tile = this.Map.getTileAt(this.Map.worldToTileX(pointer.worldX), this.Map.worldToTileY(pointer.worldY)); + let tile = this.Map.getTileAt(this.Map.worldToTileX(pointer.worldX), this.Map.worldToTileY(pointer.worldY), false, "override"); if(tile){ - this.CurrentPlayer.say("Your touch " + tile.layer.name); + if (tile.properties["say"] !== undefined){ + this.CurrentPlayer.say(tile.properties["say"]); + } } }); }