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, this.game.tweens); } , group: function (parent, name, addToStage, enableBody, physicsBodyType){ return new Phaser.Group(this.game, parent, name, addToStage, enableBody, physicsBodyType); } , spriteBatch: function (parent, name, addToStage){ if (name === undefined) { name = 'group'; } if (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); } , audioSprite: function (key){ return this.game.sound.addSprite(key); } , 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); } , rope: function (x, y, key, frame, points){ return new Phaser.Rope(this.game, x, y, key, frame, points); } , 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, align){ return new Phaser.BitmapText(this.game, x, y, font, text, size, align); } , 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 (key === undefined || key === '') { key = this.game.rnd.uuid(); } if (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 (addToCache === undefined) { addToCache = false ; } if (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.slice.call(arguments, 1); var filter = new Phaser.Filter[filter](this.game); filter.init.apply(filter, args); return filter; } } ; Phaser.GameObjectCreator.prototype.constructor = Phaser.GameObjectCreator;