Jump to content

Can Phaser3 do fullscreen?


daehee1
 Share

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

Link to comment
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]();})

 

Link to comment
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?

Link to comment
Share on other sites

  • 9 months later...
  • 1 year later...

I've wasted hours trying to figure out why my game won't go into fullscreen. It doesn't error, it just ignores the this.scale.startFullscreen call.  After reading dozens of suggestions on multiple sites, I've come to the conclusion that the problem could be the fullscreenTarget, which is getting set to a generic "DIV".  I'm not a hard core programmer. I would really appreciate anyone helping me on this. It works in the games I've created with 2.6.2 (after days of similar hacking and trial and error) but now I'm trying to do my first game on 3.22 and am very frustrated.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...