phaser/v3/src/gameobjects/quad/QuadFactory.js

23 lines
472 B
JavaScript
Raw Normal View History

2017-05-19 19:07:30 +00:00
var Quad = require('./Quad');
var BuildFromConfig = require('./BuildFromConfig');
var FactoryContainer = require('../../gameobjects/FactoryContainer');
var QuadFactory = {
KEY: 'quad',
add: function (x, y, key, frame)
{
return this.children.add(new Quad(this.state, x, y, key, frame));
},
make: function (config)
{
return BuildFromConfig(this.state, config);
}
};
module.exports = FactoryContainer.register(QuadFactory);