mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
Game Objects module includes factories now
This commit is contained in:
parent
229af2dffd
commit
651a6b3fac
2 changed files with 24 additions and 1 deletions
|
@ -16,17 +16,38 @@ var GameObjects = {
|
|||
Text: require('./text/static/Text'),
|
||||
Tilemap: require('./tilemap/dynamic/Tilemap'),
|
||||
TileSprite: require('./tilesprite/TileSprite'),
|
||||
Zone: require('./zone/Zone')
|
||||
Zone: require('./zone/Zone'),
|
||||
|
||||
// Game Object Factories
|
||||
BlitterFactory: require('./blitter/BlitterFactory'),
|
||||
DynamicBitmapTextFactory: require('./bitmaptext/dynamic/DynamicBitmapTextFactory'),
|
||||
DynamicTilemapFactory: require('./tilemap/dynamic/TilemapFactory'),
|
||||
GraphicsFactory: require('./graphics/GraphicsFactory'),
|
||||
GroupFactory: require('./group/GroupFactory'),
|
||||
ImageFactory: require('./image/ImageFactory'),
|
||||
SpriteFactory: require('./sprite/SpriteFactory'),
|
||||
StaticBitmapTextFactory: require('./bitmaptext/static/BitmapTextFactory'),
|
||||
StaticTilemapFactory: require('./tilemap/static/StaticTilemapFactory'),
|
||||
TextFactory: require('./text/static/TextFactory'),
|
||||
TileSpriteFactory: require('./tilesprite/TileSpriteFactory'),
|
||||
ZoneFactory: require('./zone/ZoneFactory'),
|
||||
|
||||
};
|
||||
|
||||
if (WEBGL_RENDERER)
|
||||
{
|
||||
// WebGL only Game Objects
|
||||
GameObjects.EffectLayer = require('./effectlayer/EffectLayer');
|
||||
GameObjects.LightLayer = require('./lightlayer/LightLayer');
|
||||
GameObjects.Mesh = require('./mesh/Mesh');
|
||||
GameObjects.Quad = require('./quad/Quad');
|
||||
GameObjects.RenderPass = require('./renderpass/RenderPass.js');
|
||||
|
||||
GameObjects.EffectLayerFactory = require('./effectlayer/EffectLayerFactory');
|
||||
GameObjects.LightLayerFactory = require('./lightlayer/LightLayerFactory');
|
||||
GameObjects.MeshFactory = require('./mesh/MeshFactory');
|
||||
GameObjects.QuadFactory = require('./quad/QuadFactory');
|
||||
GameObjects.RenderPassFactory = require('./renderpass/RenderPassFactory');
|
||||
}
|
||||
|
||||
module.exports = GameObjects;
|
||||
|
|
|
@ -46,6 +46,8 @@ var GameObjectFactory = new Class({
|
|||
|
||||
GameObjectFactory.register = function (type, factoryFunction)
|
||||
{
|
||||
// console.log('register', type);
|
||||
|
||||
if (!GameObjectFactory.prototype.hasOwnProperty(type))
|
||||
{
|
||||
GameObjectFactory.prototype[type] = factoryFunction;
|
||||
|
|
Loading…
Reference in a new issue