Jump to content

Can't wrap my head around game scaling


Moczan
 Share

Recommended Posts

Hi! I'm pretty new to Phaser and JS in general and I immediately have problem understanding how to scale my game. What I want to achieve is to have my game be an 320 x 480 object in top-center of my page and be able to scale it using CSS. This is what I used while playing with haXe html5 target and it worked wonders for me, but even if I setup the most basic Phaser project (displaying just one static image) it displays it in left-top corner and adds some weird margins etc. when I check the <div> in bowser's dev tools. I'm not sure why it has been complicated like this and how should I get rid of it?

Link to comment
Share on other sites

Those doesn't work for me either, basically I want it to work for FGL with their AutoScaler but Phaser keeps trying to do his own resizing even if I ask him not to by setting scaleMode to NO_SCALE. So my question is how to display a 320 x 480 image using Phaser and scale it ONLY using CSS, without any Phaser-specific, background scaling shenanigans.

Link to comment
Share on other sites

Yep, it's great that it takes care of all the stuff, I've manage to get it to work using ScaleManager, guess I will have to dig into source code to fully understand how it works, so I don't hit a wall debugging on some corner cases somewhere along the road. 

Anyway thanks for pointing those project templates to me, I've managed to learn some basic Phaser workflow thanks to them!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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