Hi,
I need to give users the possibility to set fullscreen when running an application in the browser (HTML5 target), locking the rotation to landscape. How do I achieve this?
I’d like to know also if it is possible to tell the url and tabs header, and the controls footer in iOS to go away when running the application: I noticed that they go away whenever they want, rotating the cell/tablet or doing something, I didn’t understand exactly when this happens, but I’d like to force this.
I’m not sure how you’d go about automatically setting fullscreen in a browser (I think it has to be a user triggered) but I came across this tutorial on how to handle orientation:
The tutorial uses phaser but the ideas there should be applicable to haxe/openfl (especially if you’re using the browser package that comes with haxe).
Same hack that the assets loading topic : browser stuff is native html/css/javascript.
To lock the orientation (and master how your app behaves on mobile), you could use this.
I guess the browser support is better now than it was when this post was written.
To achieve real fullscreen, there’s an Html5 Javascript API that works great on decently recent browsers.
It’s really simple to use, and works great.
You now just have to figure how to trigger it from your .hx app… but you could just embed the js code in your click callback on the “fullscreen” button.
And then it requires the user to add your page to his homepage.
Then when he launches your game like he would of a real native app, he’ll have it fullscreened…
I wonder why people don’t use that feature more often !
Currently “fullscreen” is a flag that on HTML5 assumes it scales to the full screen, but I’d like to see this improved more within Lime, open to contributions/suggestions, but we have to bear in mind what different browsers do support
I’m trying to get this Fullscreen API to work, but even with the ‘how to insert native js’ link example I’m still failing to get it to work.
Do you have an example of how you’ve integrated it successfully ? I keep getting the error " Class<js.Lib> has no field document " even though I’ve imported js.Lib