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

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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