greendot Posted July 4, 2018 Share Posted July 4, 2018 Hi everyone, I'm working on my first Phaser 3 game and have a question regarding the game resolution. Currently I have the game set to a fixed width and height and the coordinates of the GameObjects are hardcoded. If I want the game to autoscale, what's the best approach on how to place GameObjects in a scene? Link to comment Share on other sites More sharing options...
greendot Posted July 10, 2018 Author Share Posted July 10, 2018 Bumping this in hope for an answer.. Link to comment Share on other sites More sharing options...
Antriel Posted July 10, 2018 Share Posted July 10, 2018 https://github.com/phaser-discord/community/blob/master/FAQ.md#is-there-a-scalemanager-in-v3 Basically it depends on how far you want to go and it's also game specific. Personally I fill the whole screen and depending on what the game is either display more of the world or just scale it, or shift things around. UI is always positioned relatively so it scales, game objects might or might not be (usually not, but again, depends on the game). Link to comment Share on other sites More sharing options...
wclarkson Posted July 10, 2018 Share Posted July 10, 2018 I agree with Antriel about placing thing relative. This is the method I'm using https://phasergames.com/scaling-games-in-phaser-3/ Link to comment Share on other sites More sharing options...
greendot Posted July 10, 2018 Author Share Posted July 10, 2018 Thanks guys, I'm going over those links. Link to comment Share on other sites More sharing options...
Tom Atom Posted July 10, 2018 Share Posted July 10, 2018 One thing that helps me a lot, especially in scenes like menu, splash, etc., is to place world coordinates 0,0 into center of screen. Then many things can be placed relative to it and on resize you do not have to reposition it. Of course, it does not work with things that should be stuck to screen borders. Link to comment Share on other sites More sharing options...
greendot Posted July 11, 2018 Author Share Posted July 11, 2018 I'm now using the method suggested by @wclarkson, it's working great. Thanks guys! Link to comment Share on other sites More sharing options...
Recommended Posts