Detailed Description

SpriteBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call (often known as "batch draw").

A SpriteBatchNode can reference one and only one texture (one image file, one texture atlas). Only the Sprites that are contained in that texture can be added to the SpriteBatchNode. All Sprites added to a SpriteBatchNode are drawn in one OpenGL ES draw call. If the Sprites are not added to a SpriteBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient.

Limitations:

The only object that is accepted as child (or grandchild, grand-grandchild, etc...) is Sprite or any subclass of Sprite. eg: particles, labels and layer can't be added to a SpriteBatchNode.

Either all its children are Aliased or Antialiased. It can't be a mix. This is because "alias" is a property of the texture, and all the sprites share the same texture.

The Sprite won't be added into the children array. This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated. For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont)

var insertQuadFromSprite

(

var

sprite,

var

index

)

protected

Inserts a quad at a certain index into the texture atlas.

The Sprite won't be added into the children array. This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated. For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont)

local insertQuadFromSprite

(

local

sprite,

local

index

)

protected

Inserts a quad at a certain index into the texture atlas.

The Sprite won't be added into the children array. This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated. For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont)

The Sprite won't be added into the children array. This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated. For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont)

var updateQuadFromSprite

(

var

sprite,

var

index

)

protected

Updates a quad at a certain index into the texture atlas.

The Sprite won't be added into the children array. This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated. For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont)

local updateQuadFromSprite

(

local

sprite,

local

index

)

protected

Updates a quad at a certain index into the texture atlas.

The Sprite won't be added into the children array. This method should be called only when you are dealing with very big AtlasSrite and when most of the Sprite won't be updated. For example: a tile map (TMXMap) or a label with lots of characters (LabelBMFont)