diff --git a/v3/src/gameobjects/index.js b/v3/src/gameobjects/index.js index 939edfe43..fb83c12b7 100644 --- a/v3/src/gameobjects/index.js +++ b/v3/src/gameobjects/index.js @@ -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; diff --git a/v3/src/scene/plugins/GameObjectFactory.js b/v3/src/scene/plugins/GameObjectFactory.js index bbf273780..c29820a6e 100644 --- a/v3/src/scene/plugins/GameObjectFactory.js +++ b/v3/src/scene/plugins/GameObjectFactory.js @@ -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;