daehee1

Can Phaser3 do fullscreen?

Recommended Posts

Maybe i am wrong but i was searching the same and i think it has been removed in Phaser 3 because the classic FullScreen API do the same job?

In the current Phaser 3 doc we can find informations about fullscreen in  "Phaser.Device" > "Fullscreen" > "request"  with the description " If the browser supports the Full Screen API this holds the call you need to use to activate it. "

https://github.com/photonstorm/phaser3-docs/tree/master/docs

https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API

Share this post


Link to post
Share on other sites

I've been trying to add a button to make the game fullscreen with thories code, but when I press the button I get 

'requestFullscreen' on 'Element': API can only be initiated by a user gesture.

This is the code that calls that function.

let fullscreen = this.add.image(16,16,'fullscreen').setInteractive()
fullscreen.on('pointerup',()=>{window['game']['canvas'][game.device.fullscreen.request]();})

 

Share this post


Link to post
Share on other sites
On 5/10/2018 at 10:32 PM, samme said:

I tried trick from "Antriel" but only give me blackscreen in firefox, it works in safari

There is warning in console for firefox "Request for fullscreen was denied because requesting element is not in the currently focused tab"

is there any other solution for fullscreen?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.