Class: Plugin

PhaserComps. Plugin

Phaser 3 plugin, adds ui_component method to scene GameObjectFactory and GameObjectCreator, that creates a PhaserComps.ComponentClip instance

Note. Factory method (scene.make.ui_component()) also adds clip instance to scene

Implementation example:

import "phaser-ui-comps"

var config = {
    type: Phaser.AUTO,
    parent: "example",
    width: 800,
    height: 600,
    scene: {
 	   create: create
    },
    plugins: {
 	   global: [
 		   PhaserComps.Plugin.DefaultCfg
 	   ]
    }
var game = new Phaser.Game(config);

create() {
    let configObject = {}; // here must be real jsfl-generated config object
    let texture_name = "your_texture_name";
    this.add.ui_component(configObject, [texture_name]);
}

new Plugin()

See:

Members


<static, constant> DefaultCfg :PluginObjectItem

Default plugin config

Type:
  • PluginObjectItem