So I am trying to overlay a debug scene over my main one. The pointer variables only seem to update for me when I click on the game and not just when I’m moving. I took this approach from the examples of input debug.
I update is running fine because if I pass the time passed from update, it will update the text perfectly.
import Phaser from "phaser";
export default class DebugScene extends Phaser.Scene {
constructor() {
super("Debug");
}
text: Phaser.GameObjects.Text;
create() {
this.text = this.add.text(10, 10, "Debug", {
fontFamily: "Arial",
fontSize: "20px",
color: "#FFF",
});
}
update(time) {
const pointer = this.input.activePointer;
this.text.setText(["x: " + pointer.x, "y: " + pointer.y]);
}
}
What’s the best way to get the pointer coordinates? Like I said, I was following a phaser 3 example.