MCPcopy Create free account
hub / github.com/melonjs/melonJS / pointerMove

Method pointerMove

packages/examples/src/examples/isometricRpg/play.ts:52–68  ·  view source on GitHub ↗

pointer move event callback

(event)

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 4

getTileMethod · 0.80
worldToLocalMethod · 0.80
tileToPixelCoordsMethod · 0.45
getRendererMethod · 0.45

Tested by

no test coverage detected