mirror of
https://github.com/photonstorm/phaser
synced 2025-01-12 13:18:49 +00:00
18 lines
470 B
JavaScript
18 lines
470 B
JavaScript
|
var Image = require('./Image');
|
||
|
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
||
|
var BuildGameObject = require('../BuildGameObject');
|
||
|
|
||
|
var BuildFromConfig = function (state, config)
|
||
|
{
|
||
|
var key = GetAdvancedValue(config, 'key', null);
|
||
|
var frame = GetAdvancedValue(config, 'frame', null);
|
||
|
|
||
|
var image = new Image(state, 0, 0, key, frame);
|
||
|
|
||
|
BuildGameObject(state, image, config);
|
||
|
|
||
|
return image;
|
||
|
};
|
||
|
|
||
|
module.exports = BuildFromConfig;
|