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

  • 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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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