cloakedninjas Posted November 2, 2015 Share Posted November 2, 2015 Typescript says you the first call of constructor() should be super() so this isn't possible: constructor() { var devicePixelRatio = Math.min(Math.round(window.devicePixelRatio), 3) || 1; super({ renderer: Phaser.AUTO, width: window.innerWidth * devicePixelRatio, height: window.innerHeight * devicePixelRatio });}But then doing this gets the error: Cannot read property 'setGameSize' of nullconstructor(gameVars:any) { super({ renderer: Phaser.AUTO, parent: 'canvasContainer' }); var devicePixelRatio = Math.min(Math.round(window.devicePixelRatio), 3) || 1; this.scale.setGameSize(window.innerWidth * devicePixelRatio, window.innerHeight * devicePixelRatio);}When does the ScaleManager come into existence? Link to comment Share on other sites More sharing options...
cloakedninjas Posted November 2, 2015 Author Share Posted November 2, 2015 In writing this post I figured it out, so rather than scrap this, I thought I'd post the solution - perhaps it can help someone in the future: The ScaleManager gets initialised in the boot() method, so you can do the following:boot() { super.boot(); this.scale.setGameSize(window.innerWidth * this.devicePixelRatio, window.innerHeight * this.devicePixelRatio);} Link to comment Share on other sites More sharing options...
Recommended Posts