Jump to content

Phaser App with Phonegap


SirSandmann
 Share

Recommended Posts

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

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...