Open apicici opened 2 years ago
This should have been solved but see this https://github.com/Davidobot/love.js/issues/16#issuecomment-818620056
I saw that when I was searching earlier, but I'm not sure how that can help. All of the things listed in that comment are already implemented in the index.html file, but the love.resize callback is never called (not even once). Is there a way to trigger love.resize from javascript?
To call lua (e.g. love.resize) from JS and vice versa, check out the Love.js API player, referenced in #26
To call lua (e.g. love.resize) from JS and vice versa, check out the Love.js API player, referenced in #26
I've been using that to make fmod work by calling JavaScript from lua, but it's not clear to me by reading the instructions how to call lua functions from JavaScript.
You can use JS.newRequest
from within love to call a JavaScript function polling the size of the canvas and call love.resize
when there is a change. Make sure you call JS.retrieveData
in the update loop. Note, you will also have to run globalizeFS.js
on the love.js
file to get FS
working in this fork. There are instructions in the README.
This is a bit of a hack. We could see about implementing stdin
stdout
for the module, which would let you interact with a repl.
I'll try that, thanks!
I just ported my game to love.js (it was a bit tricky because I'm also using fmod), and I noticed that
love.resize
is not called when the love.js canvas is resized (including when going to fullscreen mode). I havet.window.resizable = true
inconf.lua
and I tried on chromium and firefox on Linux.Is this the expected behaviour? This seems to be a similar issue to #33 (I also get blurry fullscreen because love.resize is not called), but my understanding by reading the comments there is that setting
t.window.resizable = true
should lead tolove.resize
being called when changing the canvas size.