2017-08-18 00:42:14 +00:00
|
|
|
var BlitterCreator = require('../../gameobjects/blitter/BlitterCreator');
|
|
|
|
var Class = require('../../utils/Class');
|
|
|
|
var DynamicBitmapTextCreator = require('../../gameobjects/bitmaptext/dynamic/DynamicBitmapTextCreator');
|
|
|
|
var DynamicTilemapCreator = require('../../gameobjects/tilemap/dynamic/TilemapCreator');
|
|
|
|
var GraphicsCreator = require('../../gameobjects/graphics/GraphicsCreator');
|
|
|
|
var GroupCreator = require('../../gameobjects/group/GroupCreator');
|
|
|
|
var ImageCreator = require('../../gameobjects/image/ImageCreator');
|
|
|
|
var SpriteCreator = require('../../gameobjects/sprite/SpriteCreator');
|
|
|
|
var StaticBitmapTextCreator = require('../../gameobjects/bitmaptext/static/BitmapTextCreator');
|
|
|
|
var StaticTilemapCreator = require('../../gameobjects/tilemap/static/StaticTilemapCreator');
|
|
|
|
var TextCreator = require('../../gameobjects/text/static/TextCreator');
|
|
|
|
var TileSpriteCreator = require('../../gameobjects/tilesprite/TileSpriteCreator');
|
2017-07-04 00:59:31 +00:00
|
|
|
|
2017-09-13 15:06:05 +00:00
|
|
|
var factoryDef = {
|
2017-07-04 00:59:31 +00:00
|
|
|
|
|
|
|
initialize:
|
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
function GameObjectCreator (scene)
|
2017-07-04 00:59:31 +00:00
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
this.scene = scene;
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
bitmapText: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return StaticBitmapTextCreator(this.scene, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
dynamicBitmapText: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return DynamicBitmapTextCreator(this.scene, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
blitter: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return BlitterCreator(this.scene, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
graphics: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return GraphicsCreator(this.scene, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
group: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return GroupCreator(this.scene, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
image: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return ImageCreator(this.scene, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
sprite: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return SpriteCreator(this.scene, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
text: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return TextCreator(this.scene, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
tilemap: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return DynamicTilemapCreator(this.scene, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
staticTilemap: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return StaticTilemapCreator(this.scene, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
tileSprite: function (config)
|
|
|
|
{
|
2017-07-14 13:30:20 +00:00
|
|
|
return TileSpriteCreator(this.scene, config);
|
2017-08-11 12:22:41 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
tween: function (config)
|
|
|
|
{
|
|
|
|
return this.scene.sys.tweens.create(config);
|
2017-07-04 00:59:31 +00:00
|
|
|
}
|
2017-09-13 15:06:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
if (WEBGL_RENDERER)
|
|
|
|
{
|
|
|
|
// WebGL only Game Objects
|
|
|
|
var EffectLayerCreator = require('../../gameobjects/effectlayer/EffectLayerCreator');
|
|
|
|
var MeshCreator = require('../../gameobjects/mesh/MeshCreator');
|
|
|
|
var QuadCreator = require('../../gameobjects/quad/QuadCreator');
|
|
|
|
var RenderPassCreator = require('../../gameobjects/renderpass/RenderPassCreator');
|
|
|
|
|
|
|
|
factoryDef.effectLayer = function (config)
|
|
|
|
{
|
|
|
|
return EffectLayerCreator(this.scene, config);
|
|
|
|
};
|
|
|
|
|
|
|
|
factoryDef.mesh = function (config)
|
|
|
|
{
|
|
|
|
return MeshCreator(this.scene, config);
|
|
|
|
};
|
|
|
|
|
|
|
|
factoryDef.quad = function (config)
|
|
|
|
{
|
|
|
|
return QuadCreator(this.scene, config);
|
|
|
|
};
|
|
|
|
|
|
|
|
factoryDef.renderPass = function (config)
|
|
|
|
{
|
|
|
|
return RenderPassCreator(this.scene, config);
|
|
|
|
};
|
|
|
|
}
|
2017-07-04 00:59:31 +00:00
|
|
|
|
2017-09-13 15:06:05 +00:00
|
|
|
var GameObjectCreator = new Class(factoryDef);
|
2017-07-04 00:59:31 +00:00
|
|
|
|
|
|
|
module.exports = GameObjectCreator;
|