Jump to content

Scale Inner/Outer in Cocoon using Phaser Show_All


nomatix
 Share

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.

Thanks.

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

 Share

  • Recently Browsing   0 members

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