Phaser.GameObjectCreator = function (game){ this.game = game; this.world = this.game.world; } ; Phaser.GameObjectCreator.prototype = { image: function (x, y, key, frame){ return new Phaser.Image(this.game, x, y, key, frame); } , sprite: function (x, y, key, frame){ return new Phaser.Sprite(this.game, x, y, key, frame); } , tween: function (obj){ return new Phaser.Tween(obj, this.game); } , group: function (parent, name, addToStage, enableBody, physicsBodyType){ return new Phaser.Group(this.game, null , name, addToStage, enableBody, physicsBodyType); } , spriteBatch: function (parent, name, addToStage){ if (typeof name === 'undefined') { name = 'group'; } if (typeof addToStage === 'undefined') { addToStage = false ; } return new Phaser.SpriteBatch(this.game, parent, name, addToStage); } , audio: function (key, volume, loop, connect){ return this.game.sound.add(key, volume, loop, connect); } , sound: function (key, volume, loop, connect){ return this.game.sound.add(key, volume, loop, connect); } , tileSprite: function (x, y, width, height, key, frame){ return new Phaser.TileSprite(this.game, x, y, width, height, key, frame); } , text: function (x, y, text, style){ return new Phaser.Text(this.game, x, y, text, style); } , button: function (x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame){ return new Phaser.Button(this.game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame); } , graphics: function (x, y){ return new Phaser.Graphics(this.game, x, y); } , emitter: function (x, y, maxParticles){ return new Phaser.Particles.Arcade.Emitter(this.game, x, y, maxParticles); } , retroFont: function (font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset){ return new Phaser.RetroFont(this.game, font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset); } , bitmapText: function (x, y, font, text, size){ return new Phaser.BitmapText(this.game, x, y, font, text, size); } , tilemap: function (key, tileWidth, tileHeight, width, height){ return new Phaser.Tilemap(this.game, key, tileWidth, tileHeight, width, height); } , renderTexture: function (width, height, key, addToCache){ if (typeof key === 'undefined' || key === '') { key = this.game.rnd.uuid(); } if (typeof addToCache === 'undefined') { addToCache = false ; } var texture = new Phaser.RenderTexture(this.game, width, height, key); if (addToCache) { this.game.cache.addRenderTexture(key, texture); } return texture; } , bitmapData: function (width, height, key, addToCache){ if (typeof addToCache === 'undefined') { addToCache = false ; } if (typeof key === 'undefined' || key === '') { key = this.game.rnd.uuid(); } var texture = new Phaser.BitmapData(this.game, key, width, height); if (addToCache) { this.game.cache.addBitmapData(key, texture); } return texture; } , filter: function (filter){ var args = Array.prototype.splice.call(arguments, 1); var filter = new Phaser.Filter[filter](this.game); filter.init.apply(filter, args); return filter; } } ; Phaser.GameObjectCreator.prototype.constructor = Phaser.GameObjectCreator;