rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.21k stars 260 forks source link

BBCode Text: Changing the cursor when hovering over area #255

Closed robinheidrich closed 2 years ago

robinheidrich commented 2 years ago

Currently there is no special behavior for the mouse pointer when you hover over an area. There is also no option to change the cursor.

This could be solved as follows:

  1. Add areaover and areaout events to be able to change the cursor by yourself.

  2. An option that all areas get a hand cursor when hovering.

That would be a good addition!

rexrainbow commented 2 years ago

areaover, areaout events added.

Changing cursor is another issue. It seems that no direct way to change cursor during runtime. I use this hack solution:

scene.input.manager.canvas.style.cursor = 'pointer';

See this demo

robinheidrich commented 2 years ago

Looks good, works as intended. I use scene.input.setDefaultCursor('pointer'); instead.