https://github.com/phaserjs/plugin-template
A base plugin template for Phaser 3
https://github.com/phaserjs/plugin-template
Last synced: 4 months ago
JSON representation
A base plugin template for Phaser 3
- Host: GitHub
- URL: https://github.com/phaserjs/plugin-template
- Owner: phaserjs
- License: mit
- Created: 2018-01-18T14:11:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-10T13:07:16.000Z (almost 6 years ago)
- Last Synced: 2025-01-29T11:03:43.698Z (4 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 40
- Watchers: 4
- Forks: 21
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Phaser3 Plugin Template
A base plugin template for Phaser 3 to allow you to create your own plugins.
Run `npm install` and then `npm run build` to build the plugin.
## Using Plugins in Phaser 3
You can load plugins externally, or include them in your bundle.
To load an external plugin:
```
function preload ()
{
this.load.plugin('BasePlugin', 'path/to/BasePlugin.js');
}
```Then to install it into a Scene:
```
this.sys.install('BasePlugin');
```If you load the plugins in a Preloader scene then you can add them to any other Scenes by specifying them in the plugins array:
```
var config = {
scene: {
create: create,
plugins: [ 'BasePlugin' ],
map: {
'base': 'base'
}
}
};
```More examples and instructions will follow, but for now see the [Phaser 3 Examples](https://github.com/photonstorm/phaser3-examples) repo for details.