David M Posted July 11, 2017 Share Posted July 11, 2017 Hi, First I apologise if this has already been covered but I have searched and searched and not found a clear answer. In basic terms, I am trying to build a horizontal scrolling platformer that resizes as you change the size of its container. The functionality that I am trying to achieve can be seen in the Melon JS engine and results in no blank bars to the left & right or top & bottom. Thanks in advance. David Link to comment Share on other sites More sharing options...
Tom Atom Posted July 11, 2017 Share Posted July 11, 2017 Check this post - there is discussion on scaling endless horizontal scroller: ... and in bottom is working example: Link to comment Share on other sites More sharing options...
David M Posted July 11, 2017 Author Share Posted July 11, 2017 Thanks Tom, would this also work for a platformer without the endless scroll feature? Link to comment Share on other sites More sharing options...
Tom Atom Posted July 11, 2017 Share Posted July 11, 2017 You always have to choose your scaling strategy with regard to game and how you want to present it to player. If game scrolls horizontally, it is usually better to scale it vertically so it fits height and player can see horizontally more or less of level, depending on screen size. For vertical scroller is better to scale to match width and player will see more or less of level vertically. If you have single-screen game, that does not scroll, you have to solve scaling in different way. EXACT_FIT may stretch it, which may look ugly. More compex solution is like this: http://sbcgamesdev.blogspot.cz/2015/04/phaser-tutorial-manage-different-screen.html (with special areas to compensate different screen aspects) Link to comment Share on other sites More sharing options...
David M Posted July 11, 2017 Author Share Posted July 11, 2017 Hi Tom, I've managed to look through the example you provided and seem to have a working solution, although there are issues with it not always redrawing the level tile graphics when resizing. The width of the game is wider than a single screen but not an endless scroll. Thanks again for your help. Link to comment Share on other sites More sharing options...
ncil Posted July 12, 2017 Share Posted July 12, 2017 Hi David, I recently came across this and you might find it helpful to read through: https://leanpub.com/phaserscalemanager Link to comment Share on other sites More sharing options...
Recommended Posts