Fullscreen in HTML5 #2434
TheHENOOB
started this conversation in
Show and tell
Replies: 1 comment 4 replies
-
You can fullscreen on html5 there are browser restrictions involved here to prevent malicious behavior. You need to switch to fullscreen from user imput, you can't just do it whenever you want. It should work if you make a FlxButton that triggers |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
HaxeFlixel supports fullscreen in Neko, CPP and Flash but not on HTML5, for people that are looking into making a game fullscreen in HTML5 here is a code example:
It works on a local server and on newgrounds
Notes:
<window if="html5" resizable="true" />
import js.Browser;
Browser.document.fullscreenElement != null ? Browser.document.exitFullscreen() : screen.requestFullscreen();
is the same as writing:More info:
https://gist.github.com/TheHENOOB/386d7aa395acd1c3d2f0872e639cf2d4
https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API
Beta Was this translation helpful? Give feedback.
All reactions