Jump to content

Scale Inner/Outer in Cocoon using Phaser Show_All


Recommended Posts

Hey guys, i've recently gotten my game to display near full screen using Phaser Show_All in Cocoon.io and it works well enough. The only issue is that Show_All in Phaser uses a kind of letterbox scaling that isn't supported by Cocoon and I need to center my game. Apparently you can use Scale inner/outer to do this. Anyone know how to set this up in the config or html file for Phaser? Or just in general. I may be able to adapt some code from a different framework to work for Phaser.


Link to comment
Share on other sites

I used this template  https://github.com/CocoonIO/cocoon-template-phaser/tree/master/www which works with cocoon, and then I set used Phaser.RESIZE for multi device scaling following this template http://codetuto.com/2015/08/multiscreen-development-in-phaser-2-4-2/. What wrapped it all together was adding in this code to my html file provided by Vita 

Use code:

canvas_width = window.screen.availWidth * window.devicePixelRatio;
canvas_height = window.screen.availHeight * window.devicePixelRatio;

game = new Phaser.Game(canvas_width, canvas_height, options.render, 'gamewindow');



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.

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.
  • Create New...