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.world.

name string <optional>
'group'

A name for this Sprite Batch. Not used internally but useful for debugging.

addToStage boolean <optional>
false

If set to true this Sprite Batch will be added directly to the Game.Stage instead of the parent.

Returns

The newly created Sprite Batch.

Source code: gameobjects/GameObjectFactory.js (Line 209)
doc_phaser
2017-02-14 10:48:47
Comments
Leave a Comment

Please login to continue.