Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curosr does not change even after scene sleep #6986

Open
jhoryong opened this issue Dec 17, 2024 · 0 comments
Open

Curosr does not change even after scene sleep #6986

jhoryong opened this issue Dec 17, 2024 · 0 comments

Comments

@jhoryong
Copy link

jhoryong commented Dec 17, 2024

Version

  • Phaser Version: 3.80.1
  • Operating system: Windows

Description

I am using a scene as an inventory window, so it is above another scene.
I have a image object that acts as a button, with setInteractive({ useHandCursor: true }); attached.
When I try to close the scene with scene.sleep() by clicking the button, the cursor remains as 'pointer'.
I expected the cursor to be 'default' when the scene is not active anymore.

Example Test Code

class Test1 extends Phaser.Scene {
constructor() { super('test1')} 
create() {

scene.launch('test2');
}
}

class Test2 extends Phaser.Scene {
constructor() { super('test2')} 
create() {

 const closeButton = this.add.rectangle(0, 0, 200, 200);
  closeButton.setInteractive({ useHandCursor: true });
  closeButton.on('pointerdown', () => {
      this.scale.canvas.style.cursor = 'default'; // I had to manually change the cursor.
      this.scene.sleep();
  });
}
}

const game = new Phaser.Game({
    type: Phaser.AUTO,
    width: 800,
    height: 800,
    backgroundColor: '#111111',
    scale: {
        mode: Phaser.Scale.FIT,
        autoCenter: Phaser.Scale.CENTER_BOTH
    },
    scene: [  Test1, Test2 ]
})
@jhoryong jhoryong changed the title Curosr does not change even after scene visibility set to off. Curosr does not change even after scene visibility set to off Dec 17, 2024
@jhoryong jhoryong changed the title Curosr does not change even after scene visibility set to off Curosr does not change even after scene sleep Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant