Jump to content

Proper way to scale a game in Phaser 3


malgin
 Share

Recommended Posts

Hello, community!

I've just started using Phaser 3, and it's a pleasant experience. Special thanks to team for TypeScript definitions.

I'm currently trying to implement scale logic for my game. I've read in this blog post that developers considered to change `ScaleManager` in Phaser 3, but I didn't find one in sources.
I've also tried to take a look at how resize is handler in Mario platformer from pinned topic. Author used this:

scaleMode: 0, //Phaser.ScaleManager.EXACT_FIT,

... but I didn't find `scaleMode` in Config.js object, and also didn't find any reference in Game.js object to this config property. It seems this was a way to scale game in Phaser 2, but not anymore.

My current idea is to put all game objects in a 'parent' frame (not sure which object should I used for this btw..), and scale this 'frame' in each Scene on 'resize' event. This feels awkwardly wrong to me, and I'm looking for better approach.

Would be very grateful for a hint where to look, or an advise on how to properly implement scaling.

Thank you!

Link to comment
Share on other sites

  • 3 months later...
 Share

  • Recently Browsing   0 members

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