KungFuFlames Posted May 30, 2018 Share Posted May 30, 2018 I switched to Phaser 3 for almost 3 months now. I found really useful the ScaleManager in Phaser 2. I wonder is there a implementation in Phaser 3 right now? Link to comment Share on other sites More sharing options...
B3L7 Posted May 31, 2018 Share Posted May 31, 2018 Not yet but it should hopefully be out this summer. Add Fullscreen support #3639 Link to comment Share on other sites More sharing options...
KungFuFlames Posted June 1, 2018 Author Share Posted June 1, 2018 Thanks for the response. I found This example really useful. Link to comment Share on other sites More sharing options...
KevinYen Posted June 1, 2018 Share Posted June 1, 2018 If you want to SHOW_ALL, you can use .css to implement it html, body { height: 100%; } body { margin: 0; padding: 0; background: white; } canvas { width: 100%; height: 100%; object-fit: contain; } Link to comment Share on other sites More sharing options...
KungFuFlames Posted June 1, 2018 Author Share Posted June 1, 2018 That's an alternative too. But I don't think CSS should handle entiry scaling of the game. For example your code won't make canvas to 'fit' into page body. Which is not a problem but most of the mobile games probably will try to cover the fullscreen of the divice. Although, this is easy to fix just by adding couple lines into CSS, from my experience so far I found that Sprites are losing quality with CSS methods. So JS is fine right now, but not really sure if this is good performance wise. this.events.on('resize', resize, this); function resize (width, height) { if (width === undefined) { width = this.sys.game.config.width; } if (height === undefined) { height = this.sys.game.config.height; } this.cameras.resize(width, height); this.bg.setSize(width, height); this.logo.setPosition(width / 2, height / 2); } Basicly the event will trigger on resize, then going to calculate 'things' based on new canvas size and will setup new size and position(or whatever) for Spirte. This whole process doesn't look very efficient for me. If you have any ideas how I can optimize it, I will be glad to hear your suggestions. MVMVasconcelos 1 Link to comment Share on other sites More sharing options...
Recommended Posts