Sprites group class. This object is a container to hold sprites collection + parent transformations. You need SpritesGroup to use batched rendering.
Kind: global class
Number
Matrix
Sprite
Sprite
Create the group object.
Number
Sprites 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. |
Matrix
Get group’s transformations.
Kind: instance method of SpritesGroup
Returns: Matrix
- Transformations matrix, or null if there’s nothing to apply.
Sprite
Adds 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. |
Sprite
Shift 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. |