MEJS
September 25, 2021, 10:26pm
1
Hi, I want to change my default cursor to my own by:
this.input.setDefaultCursor(‘url(assets/cursors/pointer.png), pointer’)
I’m using webpack dev-server and I cant’ access to my image. “import” option is not working in this case, so how can I get path to my cursor image? It’s problem with webpack?
Well I believe phaser 3.x is javascript not typescript, so you’d have to use require instead of import.
MEJS
September 26, 2021, 9:31am
3
I can see in devtools that image is loading as blob when i’m using “require”, but image isn’t showing in my game
MEJS
September 26, 2021, 2:09pm
4
Problem solved. You must add “auto” to the string, ex.:
this.input.setDefaultCursor(
“url(” + require(“…/public/assets/images/cursor.png”) + “), auto”
);