game-shell supports this API, can request entering with game.shell.fullscreen = true. However it cannot be requested at any time, so it adds a click event handler, then calls webkitRequestFullScreen() there. But there are a few problems:
Only the WebGL canvas element is fullscreened. other UI elements are hidden. To fix this we can use document.body as the request element instead of the canvas.
No keyboard input. Need to pass ALLOW_KEYBOARD_INPUT to the request or only the mouse controls are functional.
A bunch of the UI elements are misaligned (see below), may need :fullscreen CSS?
Would like some kind of user interface to enter/exit (something like F11 hotkey, but note fullscreen can only be requested in response to certain user actions - are key events included?)
Some of these could be changed in game-shell, but the hotkey ought to be separate (probably using voxel-keys).
A plugin to allow the user to easily enter/exit fullscreen mode, using the HTML5 Fullscreen API:
http://www.w3.org/TR/fullscreen/ (more information: http://www.sitepoint.com/use-html5-full-screen-api/)
game-shell supports this API, can request entering with
game.shell.fullscreen = true
. However it cannot be requested at any time, so it adds aclick
event handler, then calls webkitRequestFullScreen() there. But there are a few problems:document.body
as the request element instead of the canvas.ALLOW_KEYBOARD_INPUT
to the request or only the mouse controls are functional.Some of these could be changed in game-shell, but the hotkey ought to be separate (probably using voxel-keys).
For testing:
document.body.addEventListener('click', function() { document.body.webkitRequestFullScreen(document.body.ALLOW_KEYBOARD_INPUT) })
screenshots: