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