Search the Community
Showing results for tags 'Framesize'.
-
Hey guys, I am currently developing my first PhaserApp. I tried with Phonegap to make it useable for different Platforms. I used the Full Screen Mobile Project template from the Phaser git. I tried to translate it with Phonegap, but the Framesizes aren´t working at all. With the iOS emulator the Framesize suddenly changes to 4096 and nothing of the game is visible, exepct the background defined in css. Here my code for this problem: //in boot.jsinit: function () { this.input.maxPointers = 1; this.stage.disableVisibilityChange = true; if (this.game.device.desktop) { this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; //this.scale.setMinMax(480, 260, 1024, 768); /* this.scale.minWidth = 260; this.scale.minHeight = 480; this.scale.maxWidth = 768; this.scale.maxHeight = 1024; */ this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.setScreenSize(true); this.scale.refresh(); } else { this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; //this.scale.setMinMax(480, 260, 1024, 768); this.scale.minWidth = 260; this.scale.minHeight = 480; this.scale.maxWidth = 768; this.scale.maxHeight = 1024; this.scale.pageAlignHorizontally = true; this.scale.pageAlignVertically = true; this.scale.forceOrientation(true, false); this.scale.setResizeCallback(this.gameResized, this); this.scale.enterIncorrectOrientation.add(this.enterIncorrectOrientation, this); this.scale.leaveIncorrectOrientation.add(this.leaveIncorrectOrientation, this); this.scale.setScreenSize(true); this.scale.refresh(); } },// in the main.js//global variableswindow.onload = function () { var game = new Phaser.Game(1024, 768, Phaser.AUTO, 'mobilescreentest');//HTML<meta name="viewport" content="initial-scale=1 maximum-scale=1 user-scalable=0 minimal-ui" />//CSSbody { margin: 0px 0px 1px 0px; /* the extra 1px allows the iOS inner/outer check to work */ background: #fff;}#orientation { margin: 0 auto; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url(../assets/orientation.jpg); background-repeat: no-repeat; background-position: center; background-color: rgb(0, 0, 0); z-index: 999; display: none;}Maybe someone know how to fix this. In the Android emulator nothing shows up at all. My general thought was, is it even senseful (better performance) if i try to do apps for different platform, does it make more sense to do webviews for eveything, or should i stay with phonegap? Thank you for your answers, with kind regards, SirSandmann