Is it possible to call this function internally inside of an HTML5 game? Not external to the canvas.
There is no support to call JavaScript functions from Lua.
Can what Module.toggleFullscreen() calls internally be called somehow? If I have a game canvas that takes up the full window I need a way to allow users to toggle F11 style fullscreen from in a settings screen.
toggleFullscreen: function() {
if (GLFW.isFullscreen) {
GLFW.cancelFullScreen();
} else {
GLFW.requestFullScreen();
}
},
It’s not currently possible to do this from inside the engine, but it sounds like a good feature to have, on both HTML5 and other desktop targets. Added an issue for it: DEF-2079
Although not useful in this case, I just want to mention that it is actually possible to call JavaScript functions from lua, by using the webview.eval()
I wish that worked in HTML5 build! I hoped it might when I first saw it… still pretty useful. I was trying to build a GPS thing with webview, but then found that it’s not possible to properly ask for location permissions.
Another option for now, at least for HTML5, is to have a piece of text on the settings screen which says “Press F11 to go Fullscreen”