phaser/src/gameobjects/mesh/MeshFactory.js

19 lines
660 B
JavaScript
Raw Normal View History

2017-05-16 23:07:52 +00:00
var Mesh = require('./Mesh');
var GameObjectFactory = require('../GameObjectFactory');
2017-05-16 23:07:52 +00:00
// When registering a factory function 'this' refers to the GameObjectFactory context.
//
// There are several properties available to use:
//
// this.scene - a reference to the Scene that owns the GameObjectFactory
// this.displayList - a reference to the Display List the Scene owns
// this.updateList - a reference to the Update List the Scene owns
2017-05-16 23:07:52 +00:00
if (WEBGL_RENDERER)
{
GameObjectFactory.register('mesh', function (x, y, vertices, uv, key, frame)
{
return this.displayList.add(new Mesh(this.scene, x, y, vertices, uv, key, frame));
});
}