NRJ Posted October 8, 2018 Share Posted October 8, 2018 Hello everyone, I am new to phaser,can anybody provide me a simple example on how to make the game occupy the full width and height of the mobile screen(not the inner width and height of the browser, completely full screen). I am currently using Phaser3.14. Link to comment Share on other sites More sharing options...
s4m_ur4i Posted October 9, 2018 Share Posted October 9, 2018 I would guess if you make a mobile game you should consider doing it with the native code of your wrapper application. For example cordova's, cocoons, PhoneGap API - you can set it fullscreen. Same for any other Wrapper. That way your game just have to have the full resolution as you already know via innerWidth / height. It should not be phasers part to set fullscreen, by using a wrapper. If you like to scale up your game, you can set dimension in the initial game config. And then use resolution and a zoom factor class Game extends Phaser.Game { constructor() { super({ type: Phaser.WEBGL, width: 800, height: 480, scene: [Scene1], resolution: 1, //<- resolution pixelArt: true, antialias: false, backgroundColor: '#000000', zoom: 1, //<- zoom physics: { default: 'arcade', arcade: { gravity: { x: 0, y: 290 }, debug: false } } }); } } I hope I did understand what you were asking for and this will help you. Link to comment Share on other sites More sharing options...
prob Posted October 9, 2018 Share Posted October 9, 2018 You could also set it up as a Progressive Web App, without Cordova, and hide the browser UI. Link to comment Share on other sites More sharing options...
NRJ Posted October 9, 2018 Author Share Posted October 9, 2018 13 hours ago, s4m_ur4i said: For example cordova's, cocoons, PhoneGap API - you can set it fullscreen. Same for any other Wrapper. I will take a look at these options, thanks. Link to comment Share on other sites More sharing options...
NRJ Posted October 9, 2018 Author Share Posted October 9, 2018 1 hour ago, prob said: You could also set it up as a Progressive Web App, without Cordova, and hide the browser UI. I will take a look at this, thanks. Link to comment Share on other sites More sharing options...
Recommended Posts