mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 19:43:28 +00:00
22 lines
687 B
JavaScript
22 lines
687 B
JavaScript
|
var Quad = require('./Quad');
|
||
|
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
||
|
var GetValue = require('../../utils/object/GetValue');
|
||
|
var BuildGameObject = require('../BuildGameObject');
|
||
|
|
||
|
var BuildFromConfig = function (state, config)
|
||
|
{
|
||
|
var key = GetAdvancedValue(config, 'key', null);
|
||
|
var frame = GetAdvancedValue(config, 'frame', null);
|
||
|
var vertices = GetValue(config, 'vertices', []);
|
||
|
var indices = GetValue(config, 'indices', []);
|
||
|
var uv = GetValue(config, 'uv', []);
|
||
|
|
||
|
var quad = new Quad(state, 0, 0, vertices, uv, indices, key, frame);
|
||
|
|
||
|
BuildGameObject(state, quad, config);
|
||
|
|
||
|
return quad;
|
||
|
};
|
||
|
|
||
|
module.exports = BuildFromConfig;
|