
Sprites group class. This object is a container to hold sprites collection + parent transformations. You need SpritesGroup to use batched rendering.
Kind: global class
NumberMatrixSpriteSpriteCreate the group object.
NumberSprites count in group.
Kind: instance property of SpritesGroup
Returns: Number - Number of sprites in group.
Iterate all sprites.
Kind: instance method of SpritesGroup
| Param | Type | Description |
|---|---|---|
| callback | function |
Callback to run on all sprites in group. |
Set color for all sprites in group.
Kind: instance method of SpritesGroup
| Param | Type | Description |
|---|---|---|
| color | Color |
Color to set. |
MatrixGet group’s transformations.
Kind: instance method of SpritesGroup
Returns: Matrix - Transformations matrix, or null if there’s nothing to apply.
SpriteAdds a sprite to group.
Kind: instance method of SpritesGroup
Returns: Sprite - The newly added sprite.
| Param | Type | Description |
|---|---|---|
| sprite | Sprite |
Sprite to add. |
Remove a sprite from group.
Kind: instance method of SpritesGroup
| Param | Type | Description |
|---|---|---|
| sprite | Sprite |
Sprite to remove. |
SpriteShift first sprite element.
Kind: instance method of SpritesGroup
Returns: Sprite - The removed sprite.
Sort sprites.
Kind: instance method of SpritesGroup
| Param | Type | Description |
|---|---|---|
| compare | function |
Comparer method. |