You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling removeInteractive on a game object after a pointover event results in the following error. calling disableInteractive before calling remove, sometimes helps. It might take as many as 10 to 20 events to get the error.
Uncaught TypeError: Cannot read properties of undefined (reading 'cursor')
at InputManager.resetCursor (3.60.0-beta.18.js:96605:31)
at InputPlugin.disable (3.60.0-beta.18.js:98115:25)
at InputPlugin.clear (3.60.0-beta.18.js:98031:14)
at InputPlugin.preUpdate (3.60.0-beta.18.js:97769:22)
at EventEmitter.emit (3.60.0-beta.18.js:220:33)
at Systems.step (3.60.0-beta.18.js:186633:16)
at SceneManager.update (3.60.0-beta.18.js:183875:21)
at Game.step (3.60.0-beta.18.js:16986:20)
at TimeStep.step (3.60.0-beta.18.js:17991:14)
at step (3.60.0-beta.18.js:30961:19)
Still having this issue with 3.60.0 and Chrome 112. Here is a less complex example. It might take a couple dozen times to get the error, but usually i'll see it after 3 or 4:
class Example extends Phaser.Scene
{
preload ()
{
this.load.image('eye', 'assets/pics/lance-overdose-loader-eye.png');
}
create ()
{
const sprite = this.add.sprite(400, 300, 'eye').setInteractive();
sprite.on('pointerover', function (event)
{
sprite.removeInteractive();
setTimeout(()=>{
sprite.setInteractive()
this.setTint(0xffffff)
}, 300)
this.setTint(0xff0000);
});
}
}
const config = {
type: Phaser.WEBGL,
parent: 'phaser-example',
scene: Example
};
const game = new Phaser.Game(config);
Adding {useHandCursor: true} to the setInteractive config with the above example helps visualize the issue.
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
Version
Description
Calling removeInteractive on a game object after a pointover event results in the following error. calling disableInteractive before calling remove, sometimes helps. It might take as many as 10 to 20 events to get the error.
Example Test Code
Additional Information
The text was updated successfully, but these errors were encountered: