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 (state, 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(state, x, y, key, frame);
2017-05-19 19:07:30 +00:00
BuildGameObject(state, quad, config);
return quad;
};
module.exports = QuadCreator;