Closed Sheepolution closed 4 years ago
Given the window.onload
definition - if a game hides the cursor, would the cursor be hidden as soon as the game loads then? Without having to have the player click on the canvas?
Good question, I'll test this out tomorrow.
When you hide the cursor with love.mouse.setVisible(false)
, it will only be hidden when you hover over the game's canvas. Even when the game is not focused, so with the committed fix removed, it will be hidden when you hover over the canvas, but still be visible everywhere else.
When hosting your game on sites like Itch.io, it's not possible to gain focus after losing focus. This means that any key you press will not reach the game. This can be fixed by calling
window.focus
when the window is clicked.