SpriteBatchNode Class Reference
Inherits from | Node |
Location | aphid.g2d.SpriteBatchNode |
Overview
The SpriteBatchNode
is a special container for fast rendering multiple sprites with the same texture. The sprites may display different area of the texture.
Using SpriteBatchNode
may boost the rendering performance by 50%~200% than using normal Node class.
Notes: SpriteBatchNode
only supports sprites with the same texture as its subnodes. Otherwise a JavaScript exception is thrown out.
Overview of Tasks
Attributes
- Name
-
texture
- Type
-
Texture2D
- Writability
-
readwrite
Functions
- Signature
-
addChild(child, [z], [tag])
Adds a sprite with the same texture as a subnode.
- Return Type
-
SpriteBatchNode
Functions
addChild(child, [z], [tag])
Adds a sprite with the same texture as a subnode.
Parameters
Non-null
Sprite childThe child sprite MUST have the same texture as the
SpriteBatchNode
has.
Optional
int
z
Optional
int
tag
Return Value: SpriteBatchNode
Returns the same receiver for method chaining