This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean isShowing; | |
private final int maxChecks = 3; | |
private int currentChecks = 0; | |
protected void onCreate(Bundle savedInstanceState) { | |
//... | |
startChecking(); | |
} | |
private void startChecking(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up scaling stuff. It's highly recommended that you copy this code to save yourself some headaches! | |
this.game.scale.scaleMode = Phaser.ScaleManager.USER_SCALE; | |
this.game.scale.pageAlignHorizontally = true; | |
this.game.scale.pageAlignVertically = true; | |
this.game.scale.forceOrientation(true, false); | |
// Scaling function that is called on resize or orientation change! | |
this.scalingFunction = function(self) { | |
self.scaleFactor = Math.min(window.innerWidth / self.game.width, window.innerHeight / self.game.height); | |
self.game.scale.setUserScale(self.scaleFactor, self.scaleFactor); |