My game uses a 2D image as a background. I am using other in-game objects to create the illusion of interaction with the 2D background image. For example, I overlay a simple rectangle over the stairs and then set it’s alpha to 0 and angle it to properly match the angle of the stairs. This creates the illusion of sliding up the stairs when in reality the player is sliding up an invisible angled rectangle, with the player and rectangle physics being managed by MatterJS.
Because of this, I need to accurately locate various X, Y coordinates on the background image, and in a scale independent manner (i.e. - same X, Y point regardless of the user’s zoom factor with the browser tab hosting the Phaser 3 canvas).
Is there a little bit of code that I could add to my game for dev purposes only, that would display the current coordinates of the mouse and show the exact XY coordinate it is hovering over, with the coordinates being relative to the Phaser 3 canvas? Note, if you have a simpler or better way to do this please let me know. Otherwise I’ll be spending a lot of time “pixel location tweaking” to get things to look right.