GameObjectFactory#bitmapText()

bitmapText(x, y, font, text, size, group) → {Phaser.BitmapText} Create a new BitmapText object. BitmapText objects work by taking a texture file and an XML file that describes the font structure.It then generates a new Sprite object for each letter of the text, proportionally spaced out and aligned tomatch the font structure. BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the abilityto use Web Fonts. However you trade this fl

GameObjectFactory#bitmapData()

bitmapData(width, height, key, addToCache) → {Phaser.BitmapData} Create a BitmapData object. A BitmapData object can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites. Parameters Name Type Argument Default Description width number <optional> 256 The width of the BitmapData in pixels. height number <optional> 256 The height of the BitmapData in pixels. key string <optional> '' Asset key for the BitmapData when stored in t

GameObjectFactory#audioSprite()

audioSprite(key) → {Phaser.AudioSprite} Creates a new AudioSprite object. Parameters Name Type Description key string The Game.cache key of the sound that this object will use. Returns Phaser.AudioSprite - The newly created AudioSprite object. Source code: gameobjects/GameObjectFactory.js (Line 262)

GameObjectFactory#audio()

audio(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

GameObjectCreator#tween()

tween(obj) → {Phaser.Tween} Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. Parameters Name Type Description obj object Object the tween will be run on. Returns Phaser.Tween - The Tween object. Source code: gameobjects/GameObjectCreator.js (Line 68)

GameObjectCreator#tileSprite()

tileSprite(x, y, width, height, key, frame) → {Phaser.TileSprite} Creates a new TileSprite object. Parameters Name Type Description x number The x coordinate (in world space) to position the TileSprite at. y number The y coordinate (in world space) to position the TileSprite at. width number The width of the TileSprite. height number The height of the TileSprite. key string | Phaser.BitmapData | PIXI.Texture This is the image or texture used by the TileSprite during rendering. It c

GameObjectCreator#tilemap()

tilemap(key, tileWidth, tileHeight, width, height) 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 Tilemap.create or pass

GameObjectCreator#text()

text(x, y, text, style) → {Phaser.Text} Creates a new Text object. Parameters Name Type Description x number X position of the new text object. y number Y position of the new text object. text string The actual text that will be written. style object The style object containing style attributes like font, font size , etc. Returns Phaser.Text - The newly created text object. Source code: gameobjects/GameObjectCreator.js (Line 199)

GameObjectCreator#spriteBatch()

spriteBatch(parent, name, addToStage) → {Phaser.SpriteBatch} Create a new SpriteBatch. Parameters Name Type Argument Default Description parent any The parent Group or DisplayObjectContainer that will hold this group, if any. name string <optional> 'group' A name for this Group. Not used internally but useful for debugging. addToStage boolean <optional> false If set to true this Group will be added directly to the Game.Stage instead of Game.World. Returns Phas

GameObjectCreator#sprite()

sprite(x, y, key, frame) → {Phaser.Sprite} Create a new Sprite with specific position and sprite sheet key. Parameters Name Type Argument Description x number X position of the new sprite. y number Y position of the new sprite. key string | Phaser.RenderTexture | PIXI.Texture This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture. frame string | number <o