Open Bobbyjoness opened 8 years ago
Can I have a link to these examples, please?
But, ultimately, there's no mechanism for moving a mouse from JavaScript so that will never work unless browsers start exposing that functionality (and they probably never will because you really don't want a site to be able to move your mouse around and make you click stuff).
love.mouse.newCursor
seems like it should work, though. Maybe it's just not implemented in emscripten's SDL stuff.
https://github.com/emscripten-ports/SDL2/blob/master/src/video/emscripten/SDL_emscriptenmouse.c#L61
Turns out the Emscripten part of SDL just discards the surface that gets passed to it. I wonder if it would be possible to encode the surface data into base64 and use that as a data url for the CSS to change the cursor.
This actually got implemented in the emscripten ports version of SDL2. https://github.com/emscripten-ports/SDL2/pull/39
But since we're using megasource's copy of SDL2 now, I'm not sure the best way to get this into love.js. Either have to copy that change over to SDL2's main repo or patch Love's copy. Maybe @slime73 has an opinion on the best approach to this.
I ran the examples.love in the browser and it works perfectly only issue is setting the cursor position and image does not work.