Hello!
I noticed that the .setInteractive() method on a few of the GameObjects (e.g. Text) takes an optional argument for a callback function. However, I can’t seem to get it working. I have my Scene defined in an ES6 class, the Text created with the callback function as the second argument, and my callback function defined in the class.
Here’s an example of my usage:
In my create function:
this.example = this.add.text(0,0, "hello").setInteractive({ useHandCursor: true }, this.callback);
Elsewhere in my class:
callback() {
console.log("woo");
}
Can anyone assist me here? As of now I’m just using “pointerdown” listeners but this method seems more streamlined.