Jump to content

Problem scaling the game with Phaser


totallybueno
 Share

Recommended Posts

Hi there, I´m having a problem scaling a game for mobile purposes... everything works fine in desktop, the only problem is scaling in mobile, I want to scale using EXACT_FIT for this case but it´s not working at all and I don´t know why.

 

Firs of all, I´m using Phaser v2.0.7 with Pixi.js v1.6, and I can´t use a most recent version of Phaser because it´s not working with my game and cocoonjs, so not new Scale Manager at all :)

 

In my html, I create the game this way

var game = new Phaser.Game(1280, 720, Phaser.AUTO);

and the game appears on my cocoonjs launcher but really small, probably is using the minWidth and minHeight...

 

 

This is my code in Boot.js (I´m using the mobile template), can anyone tell me why is not working?, everything looks fine to me :unsure:

if (this.game.device.desktop){     //THIS PART IS OK}else{     this.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT;     this.scale.minWidth = 480;     this.scale.minHeight = 260;     this.scale.maxWidth = 1920     this.scale.maxHeight = 1080;     this.scale.forceOrientation(true, false);     this.scale.enterIncorrectOrientation.add(this.enterIncorrectOrientation, this); //THIS IS WORKING     this.scale.leaveIncorrectOrientation.add(this.leaveIncorrectOrientation, this); // THIS IS WORKING TOO     this.scale.setScreenSize(true);}
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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