Phaser API Documentation

  Version: 
<static> register(factoryType, factoryFunction)

Description:

Static method called directly by the Game Object factory functions. With this method you can register a custom GameObject factory in the GameObjectFactory, providing a name (factoryType) and the constructor (factoryFunction) in order to be called when you call to Phaser.Scene.add[ factoryType ] method.

Parameters:

name type description
factoryType string

The key of the factory that you will use to call to Phaser.Scene.add[ factoryType ] method.

factoryFunction function

The constructor function to be called when you invoke to the Phaser.Scene.add method.

Since: 3.0.0