phaser icon indicating copy to clipboard operation
phaser copied to clipboard

Phaser.pointer.worldX and Y not adjusted by camera position when over a sprite

Open RobLeachman opened this issue 2 years ago • 1 comments

Version

  • Phaser Version: 3.55.2
  • Browser: confirmed the problem using Firefox, Chrome, Edge

Description

Phaser.pointer.worldX and Y not adjusted by camera position when over a sprite

Expected: consistent coordinates whether over a sprite or not Actual: coordinates are accurate until the mouse hits a sprite and then coordinates are not offset by camera

Example Test Code

var camera = this.cameras.main;
camera.setPosition(0,-240); // tested X as well but not in recording      
.
.
this.add.sprite(300, 925, 'atlas', 'arrowDown.png').setOrigin(0, 0).setName("fiveBackButton");
.
.
console.log(`Record pointer x:${this.pointer.worldX} y:${this.pointer.worldY}`)

funkyPointer

Additional Information

Dude I'm sorry I don't have more code to test. While working up this bug I realized this.pointer.x works just fine for my game. I almost didn't click Submit but will anyway in case this can be easily found and fixed. Thanks!

RobLeachman avatar Apr 05 '23 16:04 RobLeachman

Fully testable code sample, please.

photonstorm avatar Apr 07 '23 12:04 photonstorm