2017-07-04 00:59:31 +00:00
|
|
|
var TileSprite = require('./TileSprite');
|
|
|
|
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
|
|
|
var BuildGameObject = require('../BuildGameObject');
|
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
var TileSpriteCreator = function (scene, config)
|
2017-07-04 00:59:31 +00:00
|
|
|
{
|
|
|
|
var x = GetAdvancedValue(config, 'x', 0);
|
|
|
|
var y = GetAdvancedValue(config, 'y', 0);
|
|
|
|
var width = GetAdvancedValue(config, 'width', 512);
|
|
|
|
var height = GetAdvancedValue(config, 'height', 512);
|
|
|
|
var key = GetAdvancedValue(config, 'key', '');
|
|
|
|
var frame = GetAdvancedValue(config, 'frame', '');
|
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
var tile = new TileSprite(scene, x, y, width, height, key, frame);
|
2017-07-04 00:59:31 +00:00
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
BuildGameObject(scene, tile, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
|
|
|
|
return tile;
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = TileSpriteCreator;
|