Jump to content

Shouldn't forceOrientation pause the game when the wrong orientation?


Martiny
 Share

Recommended Posts

I'm using the game.scale.forceOrientation to force my game to play always on landscape, showing a image to the player saying that they should turn their phones if it is on portrait.

 

The problem is: the game is still running in the background even when it is in the wrong orientation. Shouldn't it pause by default?

 

How could I pause?

 

It doesn't really have to be a "fancy" pause really, I'm just trying to mimic what happens when you unfocus the window the game is running in.

Link to comment
Share on other sites


not forcing a pause gives the developer maximum flexibility

here's where I'd put pause/unpause code

 

 enterIncorrectOrientation: function () {

 

        BasicGame.orientated = false;

 

        document.getElementById('orientation').style.display = 'block';

        //INSERT PAUSE LOGIC HERE

 

    },

 

    leaveIncorrectOrientation: function () {

 

        BasicGame.orientated = true;

 

        document.getElementById('orientation').style.display = 'none';

        //INSERT UNPAUSE LOGIC HERE

 

    }

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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