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

23 lines
500 B
JavaScript
Raw Normal View History

2017-05-16 23:07:52 +00:00
var Mesh = require('./Mesh');
var BuildFromConfig = require('./BuildFromConfig');
var FactoryContainer = require('../../gameobjects/FactoryContainer');
var MeshFactory = {
KEY: 'mesh',
add: function (x, y, vertices, uv, key, frame)
{
return this.children.add(new Mesh(this.state, x, y, vertices, uv, key, frame));
},
make: function (config)
{
return BuildFromConfig(this.state, config);
}
};
module.exports = FactoryContainer.register(MeshFactory);