phaser/v3/src/gameobjects/mesh/MeshCreator.js

24 lines
793 B
JavaScript
Raw Normal View History

2017-05-16 23:07:52 +00:00
var Mesh = require('./Mesh');
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
var GetValue = require('../../utils/object/GetValue');
var BuildGameObject = require('../BuildGameObject');
var MeshCreator = function (state, config)
2017-05-16 23:07:52 +00:00
{
var key = GetAdvancedValue(config, 'key', null);
var frame = GetAdvancedValue(config, 'frame', null);
var vertices = GetValue(config, 'vertices', []);
2017-05-18 19:57:05 +00:00
var indices = GetValue(config, 'indices', []);
2017-05-22 19:29:27 +00:00
var colors = GetValue(config, 'colors', []);
var alphas = GetValue(config, 'alphas', []);
2017-05-16 23:07:52 +00:00
var uv = GetValue(config, 'uv', []);
2017-05-22 19:29:27 +00:00
var mesh = new Mesh(state, 0, 0, vertices, uv, indices, colors, alphas, key, frame);
2017-05-16 23:07:52 +00:00
BuildGameObject(state, mesh, config);
return mesh;
};
module.exports = MeshCreator;