phaser/v3/src/gameobjects/graphics/GraphicsCreator.js

9 lines
310 B
JavaScript

var GameObjectCreator = require('../../scene/plugins/GameObjectCreator');
var Graphics = require('./Graphics');
// When registering a factory function 'this' refers to the GameObjectCreator context.
GameObjectCreator.register('graphics', function (config)
{
return new Graphics(this.scene, config);
});