phaser
phaser copied to clipboard
Phaser.pointer.worldX and Y not adjusted by camera position when over a sprite
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}`)

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!
Fully testable code sample, please.