Problem scaling the game with Phaser

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 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);}

Share this post

Link to post
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.

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.


  • Recently Browsing   0 members

    No registered users viewing this page.