forked from noxious/client
pointer fix
This commit is contained in:
@ -34,16 +34,21 @@ const onPointerMove = (e: Phaser.Input.Pointer) => {
|
||||
const py = scene.cameras.main.worldView.y + e.y;
|
||||
|
||||
pointer_tile.value = getTile(px, py, props.layer);
|
||||
waypoint.value.visible = true;
|
||||
if (pointer_tile.value) {
|
||||
waypoint.value.visible = true;
|
||||
|
||||
if (pointer_tile.value !== undefined) {
|
||||
// Convert tile coordinates to world coordinates
|
||||
const worldPoint = props.layer.tileToWorldXY(pointer_tile.value.x, pointer_tile.value.y);
|
||||
waypoint.value.x = worldPoint.x;
|
||||
waypoint.value.y = worldPoint.y;
|
||||
waypoint.value.x = worldPoint.x + 32;
|
||||
waypoint.value.y = worldPoint.y + 32;
|
||||
} else {
|
||||
waypoint.value.visible = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
onPreUpdate(() => {
|
||||
|
||||
})
|
||||
|
Reference in New Issue
Block a user