Closed dragoncoder047 closed 1 month ago
you don't have to do setCursor("none") on update!! that could lag the game i think, you could probably set it at the start and that'd work well
you could probably set it at the start and that'd work well
Never mind actually, that seems to work. I guess this is a docs issue because the docs for setCursor say:
setCursor(style: Cursor): void
Set cursor style (check Cursor type for possible values). Cursor will be reset to "default" every frame so use this in a per-frame action.
(emphasis mine)
you could probably set it at the start and that'd work well
Never mind actually, that seems to work. I guess this is a docs issue because the docs for setCursor say:
setCursor(style: Cursor): void
Set cursor style (check Cursor type for possible values). Cursor will be reset to "default" every frame so use this in a per-frame action.(emphasis mine)
oh that's pretty weird, i set it once at the start of my game and it worked, so not sure what could be it
Maybe also an option in fakeCursor component?
Now that we have custom fake mouse objects (#372) it's a bit counterintuitive and maybe a bit wasteful of yet another onUpdate hook to have to write
onUpdate(() => setCursor("none"))
to hide the system cursor.So I was thinking that the global
setCursor
function could have a second parametersticky
, default false, when it is true, it sets the "default" cursor that the canvas cursor gets reset to every frame, instead of the current frame's cursor. Then you could just dosetCursor("none", true)
and let the browser handle constantly hiding the cursor.I'd open a PR, but I can't find the spot in the code where the cursor gets reset at the end of the frame.