Paladin83x Posted June 7, 2018 Share Posted June 7, 2018 Hallo. I am new to Phaser and have a simple question. How can I import a Phaser Editor Project into a Website? (For example made with angular) Thank you very much. Link to comment Share on other sites More sharing options...
PhaserEditor2D Posted June 25, 2018 Share Posted June 25, 2018 Hi, A Phaser Editor project contains all the "website" content inside the WebContent folder. If you look inside it, it is a common website. I think the real question here is how to import a Phaser game into your website. To do this, you only need say Phaser the name of the DIV where to render the game. For example, place a "my-game" div somewhere in your site, and the create the phaser instance like this: window.onload = function() { var game = new Phaser.Game(320, 240, Phaser.AUTO, "my-game"); // Add the States your game has. game.state.add("Boot", Boot); game.state.add("Preloader", Preloader); game.state.start("Boot"); }; Also, remember to load the Phaser lib and your game scripts. Link to comment Share on other sites More sharing options...
Recommended Posts