Ad4m Posted June 3, 2018 Share Posted June 3, 2018 Hi all, I'm wondering where can I find the game-configuration-object's description? I was browsing the docs here and, even if I don't know if it does have what I am looking for, when I clicked in the GameConfig param link, I got an 404 Error. So now I don't know where to look for. Can you help me understand the game config object? Link to comment Share on other sites More sharing options...
KungFuFlames Posted June 3, 2018 Share Posted June 3, 2018 Game Config is pretty need, it really helps you to organize your code. Back in Phaser 2 when you instantiate Phaser you write something like this: let game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); First time I saw this I wasn't sure what are these parameters for. And these are just basic parameters that Phaser constructor can accept...Which is not really good quality good overall. Now Phaser 3 simplifies this by adding a object, called gameObject. It looks like this: let GameConfig = { type: Phaser.CANVAS, width: 800, height: 600, scene: [Boot, Game], backgroundColor: "#dbcf8b", }; The order doesn't matter, some parameters are optional so you don't have to write them all. After setting up everything, just pass the object to contructor let game = new Phaser(GameConfig); So back to your question. Just make the object yourself. plicatibu 1 Link to comment Share on other sites More sharing options...
michebn Posted June 3, 2018 Share Posted June 3, 2018 In case you were looking for the parameters you can actually have in that config object: Looks like you have to dig through the code: https://photonstorm.github.io/phaser3-docs/boot_Config.js.html The config class can be found here: https://photonstorm.github.io/phaser3-docs/Phaser.Boot.Config.html Not much Infos there anyway... Link to comment Share on other sites More sharing options...
samme Posted June 4, 2018 Share Posted June 4, 2018 On 6/3/2018 at 8:58 AM, KungFuFlames said: And these are just basic parameters that Phaser constructor can accept...Which is not really good quality good overall. https://photonstorm.github.io/phaser-ce/global.html#GameConfig Link to comment Share on other sites More sharing options...
Ad4m Posted June 8, 2018 Author Share Posted June 8, 2018 Thanks all for replying. Yes @michebn what I want i can find it at https://photonstorm.github.io/phaser3-docs/boot_Config.js.html#line-54 as you can see there's almost no description there and you have nothing here https://photonstorm.github.io/phaser3-docs/Phaser.Boot.Config.html . I was looking for something like @samme provide at https://photonstorm.github.io/phaser-ce/global.html#GameConfig but Phaser 3 not phaser-ce. Link to comment Share on other sites More sharing options...
Maharl Posted June 10, 2018 Share Posted June 10, 2018 Maybe these will be helpful: https://blog.jwiese.eu/en/2017/08/17/phaser-3-canvas-configuration/ https://rexrainbow.github.io/phaser3-rex-notes/docs/site/game/index.html https://labs.phaser.io/index.html?dir=game config/&q= Link to comment Share on other sites More sharing options...
Recommended Posts