Jump to content

stopFullScreen (resize) on mobileDevices


panovsky
 Share

Recommended Posts

Hi all!

On start canvas must be 400*225, when user need more details - canvas resize to 1280*720 and go fullscreen. 


To enter/exit fullscreen i use this code

// my default scaleManager parameters
    game.scale.minWidth = 400;
    game.scale.minHeight = 225;
    game.scale.maxWidth = 400;
    game.scale.maxHeight = 225;
    game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
    game.scale.pageAlignHorizontally = true;
    game.scale.pageAlignVertically = true;
    game.scale.updateLayout(true);
    game.scale.fullScreenScaleMode = Phaser.ScaleManager.EXACT_FIT;


// ENTER
function fsEnter(){
if (!game.scale.isFullScreen) {
    game.scale.maxWidth = 1280;
    game.scale.maxHeight = 720;
     
    game.scale.startFullScreen();
    game.scale.refresh();
}
}


// EXIT
function fsExit(){
if (game.scale.isFullScreen) {
    game.scale.maxWidth = 400;
    game.scale.maxHeight = 225;
    
    game.scale.stopFullScreen();
    game.scale.refresh();
}
} 

it's all ok on pc-browsers, but on mobile-devices i can only enter to full screen (on mobile - canvas stretch to fill).

When i try to "exit from fullscreen mode" on mobile-devices - canvas is not resize to 400*225.
Please explain - how to solve this problem?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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