GameObjectFactory#tileSprite()

tileSprite(x, y, width, height, key, frame, group) → {Phaser.TileSprite} Creates a new TileSprite object. Parameters Name Type Argument Description x number The x coordinate of the TileSprite. The coordinate is relative to any parent container this TileSprite may be in. y number The y coordinate of the TileSprite. The coordinate is relative to any parent container this TileSprite may be in. width number The width of the TileSprite. height number The height of the TileSprite.

GameObjectFactory#tilemap()

tilemap(key, tileWidth, tileHeight, width, height) → {Phaser.Tilemap} Creates a new Phaser.Tilemap object. The map can either be populated with data from a Tiled JSON file or from a CSV file.To do this pass the Cache key as the first parameter. When using Tiled data you need only provide the key.When using CSV data you must provide the key and the tileWidth and tileHeight parameters.If creating a blank tilemap to be populated later, you can either specify no parameters at all and then use Til

GameObjectFactory#text()

text(x, y, text, style, group) → {Phaser.Text} Creates a new Text object. Parameters Name Type Argument Default Description x number <optional> 0 The x coordinate of the Text. The coordinate is relative to any parent container this text may be in. y number <optional> 0 The y coordinate of the Text. The coordinate is relative to any parent container this text may be in. text string <optional> '' The text string that will be displayed. style object <optio

GameObjectFactory#spriteBatch()

spriteBatch(parent, name, addToStage) → {Phaser.SpriteBatch} A SpriteBatch is a really fast version of a Phaser Group built solely for speed.Use when you need a lot of sprites or particles all sharing the same texture.The speed gains are specifically for WebGL. In Canvas mode you won't see any real difference. Parameters Name Type Argument Default Description parent Phaser.Group | null The parent Group that will hold this Sprite Batch. Set to undefined or null to add directly to game.w

GameObjectFactory#sprite()

sprite(x, y, key, frame, group) → {Phaser.Sprite} Create a new Sprite with specific position and sprite sheet key. At its most basic a Sprite consists of a set of coordinates and a texture that is used when rendered.They also contain additional properties allowing for physics motion (via Sprite.body), input handling (via Sprite.input),events (via Sprite.events), animation (via Sprite.animations), camera culling and more. Please see the Examples for use cases. Parameters Name Type Argument De

GameObjectFactory#sound()

sound(key, volume, loop, connect) → {Phaser.Sound} Creates a new Sound object. Parameters Name Type Argument Default Description key string The Game.cache key of the sound that this object will use. volume number <optional> 1 The volume at which the sound will be played. loop boolean <optional> false Whether or not the sound will loop. connect boolean <optional> true Controls if the created Sound object will connect to the master gainNode of the SoundMa

GameObjectFactory#rope()

rope(x, y, key, frame, points, group) → {Phaser.Rope} Creates a new Rope object. Example usage: https://github.com/codevinsky/phaser-rope-demo/blob/master/dist/demo.js Parameters Name Type Argument Default Description x number <optional> 0 The x coordinate of the Rope. The coordinate is relative to any parent container this rope may be in. y number <optional> 0 The y coordinate of the Rope. The coordinate is relative to any parent container this rope may be in. key str

GameObjectFactory#retroFont()

retroFont(font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset) → {Phaser.RetroFont} Create a new RetroFont object. A RetroFont can be used as a texture for an Image or Sprite and optionally add it to the Cache.A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set.If you need variable width character support then use a BitmapText object instead. The main difference between a Retro

GameObjectFactory#renderTexture()

renderTexture(width, height, key, addToCache) → {Phaser.RenderTexture} A dynamic initially blank canvas to which images can be drawn. Parameters Name Type Argument Default Description width number <optional> 100 the width of the RenderTexture. height number <optional> 100 the height of the RenderTexture. key string <optional> '' Asset key for the RenderTexture when stored in the Cache (see addToCache parameter). addToCache boolean <optional> false

GameObjectFactory#plugin()

plugin(plugin, parameter) → {Phaser.Plugin} Add a new Plugin into the PluginManager. The Plugin must have 2 properties: game and parent. Plugin.game is set to the game reference the PluginManager uses, and parent is set to the PluginManager. Parameters Name Type Argument Description plugin object | Phaser.Plugin The Plugin to add into the PluginManager. This can be a function or an existing object. parameter * <repeatable> Additional parameters that will be passed to the Plugin.