pointer move event callback
(event)
| 50 | |
| 51 | /** pointer move event callback */ |
| 52 | pointerMove(event) { |
| 53 | const tile = this.refLayer.getTile(event.gameWorldX, event.gameWorldY); |
| 54 | if (tile && tile !== this.currentTile) { |
| 55 | // get the tile x/y world isometric coordinates |
| 56 | this.refLayer |
| 57 | .getRenderer() |
| 58 | .tileToPixelCoords(tile.col, tile.row, this.diamondShape.pos); |
| 59 | // convert thhe diamon shape pos to floating coordinates |
| 60 | game.viewport.worldToLocal( |
| 61 | this.diamondShape.pos.x, |
| 62 | this.diamondShape.pos.y, |
| 63 | this.diamondShape.pos, |
| 64 | ); |
| 65 | // store the current tile |
| 66 | this.currentTile = tile; |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /** viewport move event callback */ |
| 71 | viewportMove(_pos) { |
nothing calls this directly
no test coverage detected