Jump to content

Any way to scale the entire game up?


oxysoft
 Share

Recommended Posts

I have a basic pixel art game that I would like to be scaled up because it is very small right now

 

 
This works, but breaks the camera considerably

game.world.scale.setTo(3, 3);

 
This works but breaks the TilemapLayer considerably

// (Scaling everything manually)sprite.scale.setTo(3, 3);layer.scale.setTo(3, 3);// ...

So is there a definite way to scale the game up without having to export every single sprites at magnified sizes? At first, I didn't think it would be this hard of a task

Link to comment
Share on other sites

I usually do it this way.

game.scale.width = //pixel valuegame.scale.height = //pixel valuegame.scale.refresh();

 

Is there a way to turn off smoothing with this?

 

Both of these do not work (or may be browser specific?)

 

game.antialias = false; //does not work
game.stage.scale.smoothed = false; //does not work
Link to comment
Share on other sites

Look here: http://www.photonstorm.com/phaser/pixel-perfect-scaling-a-phaser-game

 

That's how I did it when I made a game at 160x144 for GBJam3. If you scroll down to the comments, there's a link to a modified version of the basic multi-state game template that has the scaling all set up. The main disadvantage of this method is that you won't be able to use mouse controls without a fair bit of effort, but low-resolution games typically don't have those anyways.

Link to comment
Share on other sites

Hm, I'm pretty sure I just saw a website running tests on canvas scaling a few days ago, where they also used the technique described in that post. Maybe that article was outdated then.

Thanks for clearing that up.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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