blackhawx Posted October 5, 2018 Share Posted October 5, 2018 I'm on Phaser 3.14 If I have the following HTML shell setup... <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title><%= htmlWebpackPlugin.options.title %></title> </head> <body> </body> </html> and within my game.js file have the following configurations setup... const config = { type: Phaser.AUTO, width: 500, height: 300, parent: 'mphaser', dom: { createContainer: true }, title: 'my game', backgroundColor: '#ffcc00', scene: [PreloadScene, MainScene] }; let game = new Phaser.Game(config); and run the game...I don't see a <div id="mphaser"> wrapping around my canvas, or within the DOM at all. I think I understand the purpose of dom: { createContainer }, but from my testing, it's just as good as removing it from my configurations. Am I missing something? Thanks Link to comment Share on other sites More sharing options...
cornstipated Posted October 5, 2018 Share Posted October 5, 2018 parent isnt created automatically. If there an element with id parent then createContainer flag will append a properly styled div to it and create the canvas in there. If parent has a bogus value then it will just default to the body element blackhawx 1 Link to comment Share on other sites More sharing options...
Recommended Posts