当你在可点击的方向移动光标时,将光标变成手 width Phaser 3
turn the cursor into a hand when you move the cursor in a clickable direction width phaser 3
你能告诉我如何把光标变成一只手当我把光标指向一个可点击的方向,但是当我指向时手没有出现:
balls.getChildren().forEach(
s => s.setInteractive({ cursor: 'url(./src/games/gewgly/assets/images/pointer.png). pointer'
})
);
要在用户将鼠标悬停在特定区域上时更改光标图像,您可以使用 this example 等输入事件。
this.input.on('gameobjectover', function (pointer, gameObject) {
document.body.style.cursor = 'url("http://lorempixel.com/23/23/"), default';
});
this.input.on('gameobjectout', function (pointer, gameObject) {
document.body.style.cursor = 'default';
});
你能告诉我如何把光标变成一只手当我把光标指向一个可点击的方向,但是当我指向时手没有出现:
balls.getChildren().forEach(
s => s.setInteractive({ cursor: 'url(./src/games/gewgly/assets/images/pointer.png). pointer'
})
);
要在用户将鼠标悬停在特定区域上时更改光标图像,您可以使用 this example 等输入事件。
this.input.on('gameobjectover', function (pointer, gameObject) {
document.body.style.cursor = 'url("http://lorempixel.com/23/23/"), default';
});
this.input.on('gameobjectout', function (pointer, gameObject) {
document.body.style.cursor = 'default';
});