Jump to content

Phaser Editor


Paladin83x
 Share

Recommended Posts

  • 3 weeks later...

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...