mirror of
https://github.com/photonstorm/phaser
synced 2025-01-12 13:18:49 +00:00
18 lines
656 B
JavaScript
18 lines
656 B
JavaScript
var BuildGameObject = require('../BuildGameObject');
|
|
var GameObjectCreator = require('../../scene/plugins/GameObjectCreator');
|
|
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
|
var ParticleEmitter = require('./ParticleEmitter');
|
|
|
|
// When registering a factory function 'this' refers to the GameObjectCreator context.
|
|
|
|
GameObjectCreator.register('particles', function (config)
|
|
{
|
|
var key = GetAdvancedValue(config, 'key', null);
|
|
var frame = GetAdvancedValue(config, 'frame', null);
|
|
|
|
var emitter = new ParticleEmitter(this.scene, 0, 0, key, frame);
|
|
|
|
BuildGameObject(this.scene, emitter, config);
|
|
|
|
return emitter;
|
|
});
|