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

20 lines
548 B
JavaScript
Raw Normal View History

2017-05-19 19:07:30 +00:00
var Quad = require('./Quad');
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
var BuildGameObject = require('../BuildGameObject');
var QuadCreator = function (scene, config)
2017-05-19 19:07:30 +00:00
{
var x = GetAdvancedValue(config, 'x', 0);
var y = GetAdvancedValue(config, 'y', 0);
2017-05-19 19:07:30 +00:00
var key = GetAdvancedValue(config, 'key', null);
var frame = GetAdvancedValue(config, 'frame', null);
var quad = new Quad(scene, x, y, key, frame);
2017-05-19 19:07:30 +00:00
BuildGameObject(scene, quad, config);
2017-05-19 19:07:30 +00:00
return quad;
};
module.exports = QuadCreator;