cocos2d-x  2.2.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Sprite Nodes

Classes

class  CCAnimationFrame
 CCAnimationFrame A frame of the animation. More...
 
class  CCAnimation
 A CCAnimation object is used to perform animations on the CCSprite objects. More...
 
class  CCAnimationCache
 Singleton that manages the Animations. More...
 
class  CCSprite
 CCSprite is a 2d image ( http://en.wikipedia.org/wiki/Sprite_(computer_graphics) ) More...
 
class  CCSpriteBatchNode
 CCSpriteBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call (often known as "batch draw"). More...
 
class  CCSpriteFrame
 A CCSpriteFrame has: More...
 
class  CCSpriteFrameCache
 Singleton that handles the loading of the sprite frames. More...
 

Macros

#define CCSpriteIndexNotInitialized   0xffffffff
#define kDefaultSpriteBatchCapacity   29

Functions

void updateColor (void)
virtual void setTextureCoords (CCRect rect)
local setTextureCoords ( local rect)
virtual void updateBlendFunc (void)
virtual void setReorderChildDirtyRecursively (void)
local setReorderChildDirtyRecursively ()
virtual void setDirtyRecursively (bool bValue)

Variables

CCTextureAtlas * m_pobTextureAtlas
unsigned int m_uAtlasIndex
 CCSpriteBatchNode texture atlas (weak reference) More...
 
var m_uAtlasIndex
 CCSpriteBatchNode texture atlas (weak reference) More...
 
local m_uAtlasIndex
 CCSpriteBatchNode texture atlas (weak reference) More...
 
CCSpriteBatchNode * m_pobBatchNode
 Absolute (real) Index on the SpriteSheet. More...
 
bool m_bDirty
 Used batch node (weak reference) More...
 
bool m_bRecursiveDirty
 Whether the sprite needs to be updated. More...
 
var m_bRecursiveDirty
 Whether the sprite needs to be updated. More...
 
local m_bRecursiveDirty
 Whether the sprite needs to be updated. More...
 
bool m_bHasChildren
 Whether all of the sprite's children needs to be updated. More...
 
bool m_bShouldBeHidden
 Whether the sprite contains children. More...
 
var m_bShouldBeHidden
 Whether the sprite contains children. More...
 
local m_bShouldBeHidden
 Whether the sprite contains children. More...
 
CCAffineTransform m_transformToBatch
 should not be drawn because one of the ancestors is not visible More...
 
var m_transformToBatch
 should not be drawn because one of the ancestors is not visible More...
 
local m_transformToBatch
 should not be drawn because one of the ancestors is not visible More...
 
ccBlendFunc m_sBlendFunc
CCTexture2D * m_pobTexture
 It's required for CCTextureProtocol inheritance. More...
 
var m_pobTexture
 It's required for CCTextureProtocol inheritance. More...
 
local m_pobTexture
 It's required for CCTextureProtocol inheritance. More...
 
CCRect m_obRect
 CCTexture2D object that is used to render the sprite. More...
 
bool m_bRectRotated
 Retangle of CCTexture2D. More...
 
CCPoint m_obOffsetPosition
 Whether the texture is rotated. More...
 
var m_obOffsetPosition
 Whether the texture is rotated. More...
 
local m_obOffsetPosition
 Whether the texture is rotated. More...
 
CCPoint m_obUnflippedOffsetPositionFromCenter
var m_obUnflippedOffsetPositionFromCenter
local m_obUnflippedOffsetPositionFromCenter
ccV3F_C4B_T2F_Quad m_sQuad
local m_sQuad
bool m_bOpacityModifyRGB
var m_bOpacityModifyRGB
local m_bOpacityModifyRGB
bool m_bFlipX
bool m_bFlipY
 Whether the sprite is flipped horizaontally or not. More...
 
var m_bFlipY
 Whether the sprite is flipped horizaontally or not. More...
 
local m_bFlipY
 Whether the sprite is flipped horizaontally or not. More...
 

Creators

static CCSprite * create ()
 Creates an empty sprite without texture. More...
 
var create ()
 Creates an empty sprite without texture. More...
 
static CCSprite * create (const char *pszFileName)
 Creates a sprite with an image filename. More...
 
var create ( var pszFileName)
 Creates a sprite with an image filename. More...
 
static CCSprite * create (const char *pszFileName, const CCRect &rect)
 Creates a sprite with an image filename and a rect. More...
 
local create ( local pszFileName, local rect)
 Creates a sprite with an image filename and a rect. More...
 
static CCSprite * createWithTexture (CCTexture2D *pTexture)
 Creates a sprite with an exsiting texture contained in a CCTexture2D object After creation, the rect will be the size of the texture, and the offset will be (0,0). More...
 
local createWithTexture ( local pTexture)
 Creates a sprite with an exsiting texture contained in a CCTexture2D object After creation, the rect will be the size of the texture, and the offset will be (0,0). More...
 
static CCSprite * createWithTexture (CCTexture2D *pTexture, const CCRect &rect)
 Creates a sprite with a texture and a rect. More...
 
var createWithTexture ( var pTexture, var rect)
 Creates a sprite with a texture and a rect. More...
 
static CCSprite * createWithSpriteFrame (CCSpriteFrame *pSpriteFrame)
 Creates a sprite with an sprite frame. More...
 
static CCSprite * createWithSpriteFrameName (const char *pszSpriteFrameName)
 Creates a sprite with an sprite frame name. More...
 
var createWithSpriteFrameName ( var pszSpriteFrameName)
 Creates a sprite with an sprite frame name. More...
 
local createWithSpriteFrameName ( local pszSpriteFrameName)
 Creates a sprite with an sprite frame name. More...
 

Initializers

 CCSprite (void)
 Default constructor. More...
 
virtual ~CCSprite (void)
 Default destructor. More...
 
virtual bool init (void)
 Initializes an empty sprite with nothing init. More...
 
virtual bool initWithTexture (CCTexture2D *pTexture)
 Initializes a sprite with a texture. More...
 
local initWithTexture ( local pTexture)
 Initializes a sprite with a texture. More...
 
virtual bool initWithTexture (CCTexture2D *pTexture, const CCRect &rect)
 Initializes a sprite with a texture and a rect. More...
 
virtual bool initWithTexture (CCTexture2D *pTexture, const CCRect &rect, bool rotated)
 Initializes a sprite with a texture and a rect in points, optionally rotated. More...
 
local initWithTexture ( local pTexture, local rect, local rotated)
 Initializes a sprite with a texture and a rect in points, optionally rotated. More...
 
virtual bool initWithSpriteFrame (CCSpriteFrame *pSpriteFrame)
 Initializes a sprite with an SpriteFrame. More...
 
local initWithSpriteFrame ( local pSpriteFrame)
 Initializes a sprite with an SpriteFrame. More...
 
virtual bool initWithSpriteFrameName (const char *pszSpriteFrameName)
 Initializes a sprite with an sprite frame name. More...
 
var initWithSpriteFrameName ( var pszSpriteFrameName)
 Initializes a sprite with an sprite frame name. More...
 
local initWithSpriteFrameName ( local pszSpriteFrameName)
 Initializes a sprite with an sprite frame name. More...
 
virtual bool initWithFile (const char *pszFilename)
 Initializes a sprite with an image filename. More...
 
local initWithFile ( local pszFilename)
 Initializes a sprite with an image filename. More...
 
virtual bool initWithFile (const char *pszFilename, const CCRect &rect)
 Initializes a sprite with an image filename, and a rect. More...
 
var init ( var pszFilename, var rect)
 Initializes a sprite with an image filename, and a rect. More...
 
local initWithFile ( local pszFilename, local rect)
 Initializes a sprite with an image filename, and a rect. More...
 

Functions inherited from CCTextureProtocol

virtual void setTexture (CCTexture2D *texture)
 Sets a new texuture. More...
 
virtual CCTexture2D * getTexture (void)
 Returns the currently used texture. More...
 
void setBlendFunc (ccBlendFunc blendFunc)
 Sets the source blending function. More...
 
ccBlendFunc getBlendFunc (void)
 Returns the blending function that is currently being used. More...
 
local getBlendFunc ()
 Returns the blending function that is currently being used. More...
 

Functions inherited from CCNode

virtual void setScaleX (float fScaleX)
 Changes the scale factor on X axis of this node. More...
 
virtual void setScaleY (float fScaleY)
 Changes the scale factor on Y axis of this node. More...
 
local setScaleY ( local fScaleY)
 Changes the scale factor on Y axis of this node. More...
 
virtual void setPosition (const CCPoint &pos)
 Changes the position (x,y) of the node in OpenGL coordinates. More...
 
virtual void setRotation (float fRotation)
 Sets the rotation (angle) of the node in degrees. More...
 
var setRotation ( var fRotation)
 Sets the rotation (angle) of the node in degrees. More...
 
local setRotation ( local fRotation)
 Sets the rotation (angle) of the node in degrees. More...
 
virtual void setRotationX (float fRotationX)
 Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew. More...
 
local setRotationX ( local fRotationX)
 Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew. More...
 
virtual void setRotationY (float fRotationY)
 Sets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew. More...
 
local setRotationY ( local fRotationY)
 Sets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew. More...
 
virtual void setSkewX (float sx)
 Changes the X skew angle of the node in degrees. More...
 
var setSkewX ( var sx)
 Changes the X skew angle of the node in degrees. More...
 
local setSkewX ( local sx)
 Changes the X skew angle of the node in degrees. More...
 
virtual void setSkewY (float sy)
 Changes the Y skew angle of the node in degrees. More...
 
local setSkewY ( local sy)
 Changes the Y skew angle of the node in degrees. More...
 
virtual void removeChild (CCNode *pChild, bool bCleanup)
 Removes a child from the container. More...
 
local removeChild ( local pChild, local bCleanup)
 Removes a child from the container. More...
 
virtual void removeAllChildrenWithCleanup (bool bCleanup)
 Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter. More...
 
local removeAllChildrenWithCleanup ( local bCleanup)
 Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter. More...
 
virtual void reorderChild (CCNode *pChild, int zOrder)
 Reorders a child according to a new z value. More...
 
var reorderChild ( var pChild, var zOrder)
 Reorders a child according to a new z value. More...
 
local reorderChild ( local pChild, local zOrder)
 Reorders a child according to a new z value. More...
 
virtual void addChild (CCNode *pChild)
 Adds a child to the container with z-order as 0. More...
 
virtual void addChild (CCNode *pChild, int zOrder)
 Adds a child to the container with a z-order. More...
 
local addChild ( local pChild, local zOrder)
 Adds a child to the container with a z-order. More...
 
virtual void addChild (CCNode *pChild, int zOrder, int tag)
 Adds a child to the container with z order and tag. More...
 
virtual void sortAllChildren ()
 Sorts the children array once before drawing, instead of every time when a child is added or reordered. More...
 
virtual void setScale (float fScale)
 Changes both X and Y scale factor of the node. More...
 
local setScale ( local fScale)
 Changes both X and Y scale factor of the node. More...
 
virtual void setVertexZ (float fVertexZ)
 Sets the real OpenGL Z vertex. More...
 
local setVertexZ ( local fVertexZ)
 Sets the real OpenGL Z vertex. More...
 
virtual void setAnchorPoint (const CCPoint &anchor)
 Sets the anchor point in percent. More...
 
local setAnchorPoint ( local anchor)
 Sets the anchor point in percent. More...
 
virtual void ignoreAnchorPointForPosition (bool value)
 Sets whether the anchor point will be (0,0) when you position this node. More...
 
local ignoreAnchorPointForPosition ( local value)
 Sets whether the anchor point will be (0,0) when you position this node. More...
 
virtual void setVisible (bool bVisible)
 Sets whether the node is visible. More...
 
virtual void draw (void)
 Override this method to draw your own node. More...
 
local draw ()
 Override this method to draw your own node. More...
 

Functions inherited from CCNodeRGBA

virtual void setColor (const ccColor3B &color3)
 @ More...
 
local setColor ( local color3)
 @ More...
 
virtual void updateDisplayedColor (const ccColor3B &parentColor)
 recursive method that updates display color More...
 
local updateDisplayedColor ( local parentColor)
 recursive method that updates display color More...
 
virtual void setOpacity (GLubyte opacity)
 Changes the opacity. More...
 
virtual void setOpacityModifyRGB (bool modify)
 Changes the OpacityModifyRGB property. More...
 
local setOpacityModifyRGB ( local modify)
 Changes the OpacityModifyRGB property. More...
 
virtual bool isOpacityModifyRGB (void)
 Returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity) More...
 
virtual void updateDisplayedOpacity (GLubyte parentOpacity)
 recursive method that updates the displayed opacity. More...
 
var updateDisplayedOpacity ( var parentOpacity)
 recursive method that updates the displayed opacity. More...
 
local updateDisplayedOpacity ( local parentOpacity)
 recursive method that updates the displayed opacity. More...
 

BatchNode methods

virtual void updateTransform (void)
 Updates the quad according the rotation, position, scale values. More...
 
virtual CCSpriteBatchNode * getBatchNode (void)
 Returns the batch node object if this sprite is rendered by CCSpriteBatchNode. More...
 
local getBatchNode ()
 Returns the batch node object if this sprite is rendered by CCSpriteBatchNode. More...
 
virtual void setBatchNode (CCSpriteBatchNode *pobSpriteBatchNode)
 Sets the batch node to sprite. More...
 
local setBatchNode ( local pobSpriteBatchNode)
 Sets the batch node to sprite. More...
 

Texture methods

virtual void setTextureRect (const CCRect &rect)
 Updates the texture rect of the CCSprite in points. More...
 
virtual void setTextureRect (const CCRect &rect, bool rotated, const CCSize &untrimmedSize)
 Sets the texture rect, rectRotated and untrimmed size of the CCSprite in points. More...
 
var setTextureRect ( var rect, var rotated, var untrimmedSize)
 Sets the texture rect, rectRotated and untrimmed size of the CCSprite in points. More...
 
local setTextureRect ( local rect, local rotated, local untrimmedSize)
 Sets the texture rect, rectRotated and untrimmed size of the CCSprite in points. More...
 
virtual void setVertexRect (const CCRect &rect)
 Sets the vertex rect. More...
 
var setVertexRect ( var rect)
 Sets the vertex rect. More...
 
local setVertexRect ( local rect)
 Sets the vertex rect. More...
 

Frames methods

virtual void setDisplayFrame (CCSpriteFrame *pNewFrame)
 Sets a new display frame to the CCSprite. More...
 
var setDisplayFrame ( var pNewFrame)
 Sets a new display frame to the CCSprite. More...
 
local setDisplayFrame ( local pNewFrame)
 Sets a new display frame to the CCSprite. More...
 
virtual bool isFrameDisplayed (CCSpriteFrame *pFrame)
 Returns whether or not a CCSpriteFrame is being displayed. More...
 
local isFrameDisplayed ( local pFrame)
 Returns whether or not a CCSpriteFrame is being displayed. More...
 
virtual CCSpriteFrame * displayFrame (void)
 Returns the current displayed frame. More...
 
local displayFrame ()
 Returns the current displayed frame. More...
 

Animation methods

virtual void setDisplayFrameWithAnimationName (const char *animationName, int frameIndex)
 Changes the display frame with animation name and index. More...
 
local setDisplayFrameWithAnimationName ( local animationName, local frameIndex)
 Changes the display frame with animation name and index. More...
 

Sprite Properties' setter/getters

virtual bool isDirty (void)
 Whether or not the Sprite needs to be updated in the Atlas. More...
 
virtual void setDirty (bool bDirty)
 Makes the Sprite to be updated in the Atlas. More...
 
local setDirty ( local bDirty)
 Makes the Sprite to be updated in the Atlas. More...
 
ccV3F_C4B_T2F_Quad getQuad (void)
 Returns the quad (tex coords, vertex coords and color) information. More...
 
bool isTextureRectRotated (void)
 Returns whether or not the texture rectangle is rotated. More...
 
local isTextureRectRotated ()
 Returns whether or not the texture rectangle is rotated. More...
 
unsigned int getAtlasIndex (void)
 Returns the index used on the TextureAtlas. More...
 
void setAtlasIndex (unsigned int uAtlasIndex)
 Sets the index used on the TextureAtlas. More...
 
const CCRect & getTextureRect (void)
 Returns the rect of the CCSprite in points. More...
 
var getTextureRect ()
 Returns the rect of the CCSprite in points. More...
 
local getTextureRect ()
 Returns the rect of the CCSprite in points. More...
 
CCTextureAtlas * getTextureAtlas (void)
 Gets the weak reference of the CCTextureAtlas when the sprite is rendered using via CCSpriteBatchNode. More...
 
var getTextureAtlas ()
 Gets the weak reference of the CCTextureAtlas when the sprite is rendered using via CCSpriteBatchNode. More...
 
local getTextureAtlas ()
 Gets the weak reference of the CCTextureAtlas when the sprite is rendered using via CCSpriteBatchNode. More...
 
void setTextureAtlas (CCTextureAtlas *pobTextureAtlas)
 Sets the weak reference of the CCTextureAtlas when the sprite is rendered using via CCSpriteBatchNode. More...
 
const CCPoint & getOffsetPosition (void)
 Gets the offset position of the sprite. More...
 
local getOffsetPosition ()
 Gets the offset position of the sprite. More...
 
bool isFlipX (void)
 Returns the flag which indicates whether the sprite is flipped horizontally or not. More...
 
void setFlipX (bool bFlipX)
 Sets whether the sprite should be flipped horizontally or not. More...
 
bool isFlipY (void)
 Return the flag which indicates whether the sprite is flipped vertically or not. More...
 
local isFlipY ()
 Return the flag which indicates whether the sprite is flipped vertically or not. More...
 
void setFlipY (bool bFlipY)
 Sets whether the sprite should be flipped vertically or not. More...
 

Detailed Description

Macro Definition Documentation

#define CCSpriteIndexNotInitialized   0xffffffff
#define kDefaultSpriteBatchCapacity   29
var kDefaultSpriteBatchCapacity   29
local kDefaultSpriteBatchCapacity   29

Function Documentation

CCSprite ( void  )

Default constructor.

var ctor (   )

Default constructor.

local CCSprite (   )

Default constructor.

virtual ~CCSprite ( void  )
virtual

Default destructor.

virtual void addChild ( CCNode child)
virtual

Adds a child to the container with z-order as 0.

If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.

Parameters
childA child node

Reimplemented from CCNode.

var addChild ( var  child)
virtual

Adds a child to the container with z-order as 0.

If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.

Parameters
childA child node

Reimplemented from CCNode.

local addChild ( local  child)
virtual

Adds a child to the container with z-order as 0.

If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.

Parameters
childA child node

Reimplemented from CCNode.

virtual void addChild ( CCNode child,
int  zOrder 
)
virtual

Adds a child to the container with a z-order.

If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.

Parameters
childA child node
zOrderZ order for drawing priority. Please refer to setZOrder(int)

Reimplemented from CCNode.

var addChild ( var  child,
var  zOrder 
)
virtual

Adds a child to the container with a z-order.

If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.

Parameters
childA child node
zOrderZ order for drawing priority. Please refer to setZOrder(int)

Reimplemented from CCNode.

local addChild ( local  child,
local  zOrder 
)
virtual

Adds a child to the container with a z-order.

If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.

Parameters
childA child node
zOrderZ order for drawing priority. Please refer to setZOrder(int)

Reimplemented from CCNode.

virtual void addChild ( CCNode child,
int  zOrder,
int  tag 
)
virtual

Adds a child to the container with z order and tag.

If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.

Parameters
childA child node
zOrderZ order for drawing priority. Please refer to setZOrder(int)
tagA interger to identify the node easily. Please refer to setTag(int)

Reimplemented from CCNode.

var addChild ( var  child,
var  zOrder,
var  tag 
)
virtual

Adds a child to the container with z order and tag.

If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.

Parameters
childA child node
zOrderZ order for drawing priority. Please refer to setZOrder(int)
tagA interger to identify the node easily. Please refer to setTag(int)

Reimplemented from CCNode.

local addChild ( local  child,
local  zOrder,
local  tag 
)
virtual

Adds a child to the container with z order and tag.

If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately.

Parameters
childA child node
zOrderZ order for drawing priority. Please refer to setZOrder(int)
tagA interger to identify the node easily. Please refer to setTag(int)

Reimplemented from CCNode.

static CCSprite* create ( )
static

Creates an empty sprite without texture.

You can call setTexture method subsequently.

Returns
An empty sprite object that is marked as autoreleased.
var create ( )
static

Creates an empty sprite without texture.

You can call setTexture method subsequently.

Returns
An empty sprite object that is marked as autoreleased.
local create ( )
static

Creates an empty sprite without texture.

You can call setTexture method subsequently.

Returns
An empty sprite object that is marked as autoreleased.
static CCSprite* create ( const char *  pszFileName)
static

Creates a sprite with an image filename.

After creation, the rect of sprite will be the size of the image, and the offset will be (0,0).

Parameters
pszFileNameThe string which indicates a path to image file, e.g., "scene1/monster.png".
Returns
A valid sprite object that is marked as autoreleased.
var create ( var  pszFileName)
static

Creates a sprite with an image filename.

After creation, the rect of sprite will be the size of the image, and the offset will be (0,0).

Parameters
pszFileNameThe string which indicates a path to image file, e.g., "scene1/monster.png".
Returns
A valid sprite object that is marked as autoreleased.
local create ( local  pszFileName)
static

Creates a sprite with an image filename.

After creation, the rect of sprite will be the size of the image, and the offset will be (0,0).

Parameters
pszFileNameThe string which indicates a path to image file, e.g., "scene1/monster.png".
Returns
A valid sprite object that is marked as autoreleased.
static CCSprite* create ( const char *  pszFileName,
const CCRect rect 
)
static

Creates a sprite with an image filename and a rect.

Parameters
pszFileNameThe string wich indicates a path to image file, e.g., "scene1/monster.png"
rectOnly the contents inside rect of pszFileName's texture will be applied for this sprite.
Returns
A valid sprite object that is marked as autoreleased.
var create ( var  pszFileName,
var  rect 
)
static

Creates a sprite with an image filename and a rect.

Parameters
pszFileNameThe string wich indicates a path to image file, e.g., "scene1/monster.png"
rectOnly the contents inside rect of pszFileName's texture will be applied for this sprite.
Returns
A valid sprite object that is marked as autoreleased.
local create ( local  pszFileName,
local  rect 
)
static

Creates a sprite with an image filename and a rect.

Parameters
pszFileNameThe string wich indicates a path to image file, e.g., "scene1/monster.png"
rectOnly the contents inside rect of pszFileName's texture will be applied for this sprite.
Returns
A valid sprite object that is marked as autoreleased.
static CCSprite*
createWithSpriteFrame
( CCSpriteFrame pSpriteFrame)
static

Creates a sprite with an sprite frame.

Parameters
pSpriteFrameA sprite frame which involves a texture and a rect
Returns
A valid sprite object that is marked as autoreleased.
var createWithSpriteFrame ( var  pSpriteFrame)
static

Creates a sprite with an sprite frame.

Parameters
pSpriteFrameA sprite frame which involves a texture and a rect
Returns
A valid sprite object that is marked as autoreleased.
local createWithSpriteFrame ( local  pSpriteFrame)
static

Creates a sprite with an sprite frame.

Parameters
pSpriteFrameA sprite frame which involves a texture and a rect
Returns
A valid sprite object that is marked as autoreleased.
static CCSprite*
createWithSpriteFrameName
( const char *  pszSpriteFrameName)
static

Creates a sprite with an sprite frame name.

A CCSpriteFrame will be fetched from the CCSpriteFrameCache by pszSpriteFrameName param. If the CCSpriteFrame doesn't exist it will raise an exception.

Parameters
pszSpriteFrameNameA null terminated string which indicates the sprite frame name.
Returns
A valid sprite object that is marked as autoreleased.
var createWithSpriteFrameName ( var  pszSpriteFrameName)
static

Creates a sprite with an sprite frame name.

A CCSpriteFrame will be fetched from the CCSpriteFrameCache by pszSpriteFrameName param. If the CCSpriteFrame doesn't exist it will raise an exception.

Parameters
pszSpriteFrameNameA null terminated string which indicates the sprite frame name.
Returns
A valid sprite object that is marked as autoreleased.
local createWithSpriteFrameName ( local  pszSpriteFrameName)
static

Creates a sprite with an sprite frame name.

A CCSpriteFrame will be fetched from the CCSpriteFrameCache by pszSpriteFrameName param. If the CCSpriteFrame doesn't exist it will raise an exception.

Parameters
pszSpriteFrameNameA null terminated string which indicates the sprite frame name.
Returns
A valid sprite object that is marked as autoreleased.
static CCSprite* createWithTexture ( CCTexture2D pTexture)
static

Creates a sprite with an exsiting texture contained in a CCTexture2D object After creation, the rect will be the size of the texture, and the offset will be (0,0).

Parameters
pTextureA pointer to a CCTexture2D object.
Returns
A valid sprite object that is marked as autoreleased.
var createWithTexture ( var  pTexture)
static

Creates a sprite with an exsiting texture contained in a CCTexture2D object After creation, the rect will be the size of the texture, and the offset will be (0,0).

Parameters
pTextureA pointer to a CCTexture2D object.
Returns
A valid sprite object that is marked as autoreleased.
local createWithTexture ( local  pTexture)
static

Creates a sprite with an exsiting texture contained in a CCTexture2D object After creation, the rect will be the size of the texture, and the offset will be (0,0).

Parameters
pTextureA pointer to a CCTexture2D object.
Returns
A valid sprite object that is marked as autoreleased.
static CCSprite* createWithTexture ( CCTexture2D pTexture,
const CCRect rect 
)
static

Creates a sprite with a texture and a rect.

After creation, the offset will be (0,0).

Parameters
pTextureA pointer to an existing CCTexture2D object. You can use a CCTexture2D object for many sprites.
rectOnly the contents inside the rect of this texture will be applied for this sprite.
Returns
A valid sprite object that is marked as autoreleased.
var createWithTexture ( var  pTexture,
var  rect 
)
static

Creates a sprite with a texture and a rect.

After creation, the offset will be (0,0).

Parameters
pTextureA pointer to an existing CCTexture2D object. You can use a CCTexture2D object for many sprites.
rectOnly the contents inside the rect of this texture will be applied for this sprite.
Returns
A valid sprite object that is marked as autoreleased.
local createWithTexture ( local  pTexture,
local  rect 
)
static

Creates a sprite with a texture and a rect.

After creation, the offset will be (0,0).

Parameters
pTextureA pointer to an existing CCTexture2D object. You can use a CCTexture2D object for many sprites.
rectOnly the contents inside the rect of this texture will be applied for this sprite.
Returns
A valid sprite object that is marked as autoreleased.
virtual CCSpriteFrame* displayFrame ( void  )
virtual

Returns the current displayed frame.

local displayFrame (   )
virtual

Returns the current displayed frame.

virtual void draw ( void  )
virtual

Override this method to draw your own node.

The following GL states will be enabled by default:

  • glEnableClientState(GL_VERTEX_ARRAY);
  • glEnableClientState(GL_COLOR_ARRAY);
  • glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  • glEnable(GL_TEXTURE_2D); AND YOU SHOULD NOT DISABLE THEM AFTER DRAWING YOUR NODE But if you enable any other GL state, you should disable it after drawing your node.

Reimplemented from CCNode.

Reimplemented in CCTextFieldTTF.

var draw (   )
virtual

Override this method to draw your own node.

The following GL states will be enabled by default:

  • glEnableClientState(GL_VERTEX_ARRAY);
  • glEnableClientState(GL_COLOR_ARRAY);
  • glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  • glEnable(GL_TEXTURE_2D); AND YOU SHOULD NOT DISABLE THEM AFTER DRAWING YOUR NODE But if you enable any other GL state, you should disable it after drawing your node.

Reimplemented from CCNode.

Reimplemented in CCTextFieldTTF.

local draw (   )
virtual

Override this method to draw your own node.

The following GL states will be enabled by default:

  • glEnableClientState(GL_VERTEX_ARRAY);
  • glEnableClientState(GL_COLOR_ARRAY);
  • glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  • glEnable(GL_TEXTURE_2D); AND YOU SHOULD NOT DISABLE THEM AFTER DRAWING YOUR NODE But if you enable any other GL state, you should disable it after drawing your node.

Reimplemented from CCNode.

Reimplemented in CCTextFieldTTF.

unsigned int getAtlasIndex ( void  )
inline

Returns the index used on the TextureAtlas.

var getAtlasIndex (   )
inline

Returns the index used on the TextureAtlas.

local getAtlasIndex (   )
inline

Returns the index used on the TextureAtlas.

virtual CCSpriteBatchNode*
getBatchNode
( void  )
virtual

Returns the batch node object if this sprite is rendered by CCSpriteBatchNode.

Returns
The CCSpriteBatchNode object if this sprite is rendered by CCSpriteBatchNode, NULL if the sprite isn't used batch node.
var getBatchNode (   )
virtual

Returns the batch node object if this sprite is rendered by CCSpriteBatchNode.

Returns
The CCSpriteBatchNode object if this sprite is rendered by CCSpriteBatchNode, NULL if the sprite isn't used batch node.
local getBatchNode (   )
virtual

Returns the batch node object if this sprite is rendered by CCSpriteBatchNode.

Returns
The CCSpriteBatchNode object if this sprite is rendered by CCSpriteBatchNode, NULL if the sprite isn't used batch node.
ccBlendFunc getBlendFunc ( void  )
inlinevirtual

Returns the blending function that is currently being used.

Returns
A ccBlendFunc structure with source and destination factor which specified pixel arithmetic.

Implements CCBlendProtocol.

local getBlendFunc (   )
inlinevirtual

Returns the blending function that is currently being used.

Returns
A ccBlendFunc structure with source and destination factor which specified pixel arithmetic.

Implements CCBlendProtocol.

const CCPoint& getOffsetPosition ( void  )
inline

Gets the offset position of the sprite.

Calculated automatically by editors like Zwoptex.

var getOffsetPosition (   )
inline

Gets the offset position of the sprite.

Calculated automatically by editors like Zwoptex.

local getOffsetPosition (   )
inline

Gets the offset position of the sprite.

Calculated automatically by editors like Zwoptex.

ccV3F_C4B_T2F_Quad getQuad ( void  )
inline

Returns the quad (tex coords, vertex coords and color) information.

local getQuad (   )
inline

Returns the quad (tex coords, vertex coords and color) information.

virtual CCTexture2D* getTexture ( void  )
virtual

Returns the currently used texture.

Returns
The texture that is currenlty being used.

Implements CCTextureProtocol.

var getTexture (   )
virtual

Returns the currently used texture.

Returns
The texture that is currenlty being used.

Implements CCTextureProtocol.

local getTexture (   )
virtual

Returns the currently used texture.

Returns
The texture that is currenlty being used.

Implements CCTextureProtocol.

CCTextureAtlas* getTextureAtlas ( void  )
inline

Gets the weak reference of the CCTextureAtlas when the sprite is rendered using via CCSpriteBatchNode.

var getTextureAtlas (   )
inline

Gets the weak reference of the CCTextureAtlas when the sprite is rendered using via CCSpriteBatchNode.

local getTextureAtlas (   )
inline

Gets the weak reference of the CCTextureAtlas when the sprite is rendered using via CCSpriteBatchNode.

const CCRect& getTextureRect ( void  )
inline

Returns the rect of the CCSprite in points.

var getTextureRect (   )
inline

Returns the rect of the CCSprite in points.

local getTextureRect (   )
inline

Returns the rect of the CCSprite in points.

virtual void
ignoreAnchorPointForPosition
( bool  ignore)
virtual

Sets whether the anchor point will be (0,0) when you position this node.

This is an internal method, only used by CCLayer and CCScene. Don't call it outside framework. The default value is false, while in CCLayer and CCScene are true

Parameters
ignoretrue if anchor point will be (0,0) when you position this node
Todo:
This method shoud be renamed as setIgnoreAnchorPointForPosition(bool) or something with "set"

Reimplemented from CCNode.

var ignoreAnchorPointForPosition ( var  ignore)
virtual

Sets whether the anchor point will be (0,0) when you position this node.

This is an internal method, only used by CCLayer and CCScene. Don't call it outside framework. The default value is false, while in CCLayer and CCScene are true

Parameters
ignoretrue if anchor point will be (0,0) when you position this node
Todo:
This method shoud be renamed as setIgnoreAnchorPointForPosition(bool) or something with "set"

Reimplemented from CCNode.

local ignoreAnchorPointForPosition ( local  ignore)
virtual

Sets whether the anchor point will be (0,0) when you position this node.

This is an internal method, only used by CCLayer and CCScene. Don't call it outside framework. The default value is false, while in CCLayer and CCScene are true

Parameters
ignoretrue if anchor point will be (0,0) when you position this node
Todo:
This method shoud be renamed as setIgnoreAnchorPointForPosition(bool) or something with "set"

Reimplemented from CCNode.

virtual bool init ( void  )
virtual

Initializes an empty sprite with nothing init.

Reimplemented from CCNodeRGBA.

Reimplemented in CCLabelTTF.

var init (   )
virtual

Initializes an empty sprite with nothing init.

Reimplemented from CCNodeRGBA.

Reimplemented in CCLabelTTF.

local init (   )
virtual

Initializes an empty sprite with nothing init.

Reimplemented from CCNodeRGBA.

Reimplemented in CCLabelTTF.

virtual bool initWithFile ( const char *  pszFilename)
virtual

Initializes a sprite with an image filename.

This method will find pszFilename from local file system, load its content to CCTexture2D, then use CCTexture2D to create a sprite. After initialization, the rect used will be the size of the image. The offset will be (0,0).

Parameters
pszFilenameThe path to an image file in local file system
Returns
true if the sprite is initialized properly, false otherwise.

Reimplemented in CCSkin.

var init ( var  pszFilename)
virtual

Initializes a sprite with an image filename.

This method will find pszFilename from local file system, load its content to CCTexture2D, then use CCTexture2D to create a sprite. After initialization, the rect used will be the size of the image. The offset will be (0,0).

Parameters
pszFilenameThe path to an image file in local file system
Returns
true if the sprite is initialized properly, false otherwise.

Reimplemented in CCSkin.

local initWithFile ( local  pszFilename)
virtual

Initializes a sprite with an image filename.

This method will find pszFilename from local file system, load its content to CCTexture2D, then use CCTexture2D to create a sprite. After initialization, the rect used will be the size of the image. The offset will be (0,0).

Parameters
pszFilenameThe path to an image file in local file system
Returns
true if the sprite is initialized properly, false otherwise.

Reimplemented in CCSkin.

virtual bool initWithFile ( const char *  pszFilename,
const CCRect rect 
)
virtual

Initializes a sprite with an image filename, and a rect.

This method will find pszFilename from local file system, load its content to CCTexture2D, then use CCTexture2D to create a sprite. After initialization, the offset will be (0,0).

Parameters
pszFilenameThe path to an image file in local file system.
rectThe rectangle assigned the content area from texture.
Returns
true if the sprite is initialized properly, false otherwise.
var init ( var  pszFilename,
var  rect 
)
virtual

Initializes a sprite with an image filename, and a rect.

This method will find pszFilename from local file system, load its content to CCTexture2D, then use CCTexture2D to create a sprite. After initialization, the offset will be (0,0).

Parameters
pszFilenameThe path to an image file in local file system.
rectThe rectangle assigned the content area from texture.
Returns
true if the sprite is initialized properly, false otherwise.
local initWithFile ( local  pszFilename,
local  rect 
)
virtual

Initializes a sprite with an image filename, and a rect.

This method will find pszFilename from local file system, load its content to CCTexture2D, then use CCTexture2D to create a sprite. After initialization, the offset will be (0,0).

Parameters
pszFilenameThe path to an image file in local file system.
rectThe rectangle assigned the content area from texture.
Returns
true if the sprite is initialized properly, false otherwise.
virtual bool initWithSpriteFrame ( CCSpriteFrame pSpriteFrame)
virtual

Initializes a sprite with an SpriteFrame.

The texture and rect in SpriteFrame will be applied on this sprite

Parameters
pSpriteFrameA CCSpriteFrame object. It should includes a valid texture and a rect
Returns
true if the sprite is initialized properly, false otherwise.
var initWithSpriteFrame ( var  pSpriteFrame)
virtual

Initializes a sprite with an SpriteFrame.

The texture and rect in SpriteFrame will be applied on this sprite

Parameters
pSpriteFrameA CCSpriteFrame object. It should includes a valid texture and a rect
Returns
true if the sprite is initialized properly, false otherwise.
local initWithSpriteFrame ( local  pSpriteFrame)
virtual

Initializes a sprite with an SpriteFrame.

The texture and rect in SpriteFrame will be applied on this sprite

Parameters
pSpriteFrameA CCSpriteFrame object. It should includes a valid texture and a rect
Returns
true if the sprite is initialized properly, false otherwise.
virtual bool
initWithSpriteFrameName
( const char *  pszSpriteFrameName)
virtual

Initializes a sprite with an sprite frame name.

A CCSpriteFrame will be fetched from the CCSpriteFrameCache by name. If the CCSpriteFrame doesn't exist it will raise an exception.

Parameters
pszSpriteFrameNameA key string that can fected a volid CCSpriteFrame from CCSpriteFrameCache
Returns
true if the sprite is initialized properly, false otherwise.

Reimplemented in CCSkin.

var initWithSpriteFrameName ( var  pszSpriteFrameName)
virtual

Initializes a sprite with an sprite frame name.

A CCSpriteFrame will be fetched from the CCSpriteFrameCache by name. If the CCSpriteFrame doesn't exist it will raise an exception.

Parameters
pszSpriteFrameNameA key string that can fected a volid CCSpriteFrame from CCSpriteFrameCache
Returns
true if the sprite is initialized properly, false otherwise.

Reimplemented in CCSkin.

local initWithSpriteFrameName ( local  pszSpriteFrameName)
virtual

Initializes a sprite with an sprite frame name.

A CCSpriteFrame will be fetched from the CCSpriteFrameCache by name. If the CCSpriteFrame doesn't exist it will raise an exception.

Parameters
pszSpriteFrameNameA key string that can fected a volid CCSpriteFrame from CCSpriteFrameCache
Returns
true if the sprite is initialized properly, false otherwise.

Reimplemented in CCSkin.

virtual bool initWithTexture ( CCTexture2D pTexture)
virtual

Initializes a sprite with a texture.

After initialization, the rect used will be the size of the texture, and the offset will be (0,0).

Parameters
pTextureA pointer to an existing CCTexture2D object. You can use a CCTexture2D object for many sprites.
Returns
true if the sprite is initialized properly, false otherwise.
var initWithTexture ( var  pTexture)
virtual

Initializes a sprite with a texture.

After initialization, the rect used will be the size of the texture, and the offset will be (0,0).

Parameters
pTextureA pointer to an existing CCTexture2D object. You can use a CCTexture2D object for many sprites.
Returns
true if the sprite is initialized properly, false otherwise.
local initWithTexture ( local  pTexture)
virtual

Initializes a sprite with a texture.

After initialization, the rect used will be the size of the texture, and the offset will be (0,0).

Parameters
pTextureA pointer to an existing CCTexture2D object. You can use a CCTexture2D object for many sprites.
Returns
true if the sprite is initialized properly, false otherwise.
virtual bool initWithTexture ( CCTexture2D pTexture,
const CCRect rect 
)
virtual

Initializes a sprite with a texture and a rect.

After initialization, the offset will be (0,0).

Parameters
pTextureA pointer to an exisiting CCTexture2D object. You can use a CCTexture2D object for many sprites.
rectOnly the contents inside rect of this texture will be applied for this sprite.
Returns
true if the sprite is initialized properly, false otherwise.
var initWithTexture ( var  pTexture,
var  rect 
)
virtual

Initializes a sprite with a texture and a rect.

After initialization, the offset will be (0,0).

Parameters
pTextureA pointer to an exisiting CCTexture2D object. You can use a CCTexture2D object for many sprites.
rectOnly the contents inside rect of this texture will be applied for this sprite.
Returns
true if the sprite is initialized properly, false otherwise.
local initWithTexture ( local  pTexture,
local  rect 
)
virtual

Initializes a sprite with a texture and a rect.

After initialization, the offset will be (0,0).

Parameters
pTextureA pointer to an exisiting CCTexture2D object. You can use a CCTexture2D object for many sprites.
rectOnly the contents inside rect of this texture will be applied for this sprite.
Returns
true if the sprite is initialized properly, false otherwise.
virtual bool initWithTexture ( CCTexture2D pTexture,
const CCRect rect,
bool  rotated 
)
virtual

Initializes a sprite with a texture and a rect in points, optionally rotated.

After initialization, the offset will be (0,0).

Note
This is the designated initializer.
Parameters
pTextureA CCTexture2D object whose texture will be applied to this sprite.
rectA rectangle assigned the contents of texture.
rotatedWhether or not the texture rectangle is rotated.
Returns
true if the sprite is initialized properly, false otherwise.
var initWithTexture ( var  pTexture,
var  rect,
var  rotated 
)
virtual

Initializes a sprite with a texture and a rect in points, optionally rotated.

After initialization, the offset will be (0,0).

Note
This is the designated initializer.
Parameters
pTextureA CCTexture2D object whose texture will be applied to this sprite.
rectA rectangle assigned the contents of texture.
rotatedWhether or not the texture rectangle is rotated.
Returns
true if the sprite is initialized properly, false otherwise.
local initWithTexture ( local  pTexture,
local  rect,
local  rotated 
)
virtual

Initializes a sprite with a texture and a rect in points, optionally rotated.

After initialization, the offset will be (0,0).

Note
This is the designated initializer.
Parameters
pTextureA CCTexture2D object whose texture will be applied to this sprite.
rectA rectangle assigned the contents of texture.
rotatedWhether or not the texture rectangle is rotated.
Returns
true if the sprite is initialized properly, false otherwise.
virtual bool isDirty ( void  )
inlinevirtual

Whether or not the Sprite needs to be updated in the Atlas.

Returns
true if the sprite needs to be updated in the Atlas, false otherwise.

Reimplemented in CCPhysicsSprite.

var isDirty (   )
inlinevirtual

Whether or not the Sprite needs to be updated in the Atlas.

Returns
true if the sprite needs to be updated in the Atlas, false otherwise.

Reimplemented in CCPhysicsSprite.

local isDirty (   )
inlinevirtual

Whether or not the Sprite needs to be updated in the Atlas.

Returns
true if the sprite needs to be updated in the Atlas, false otherwise.

Reimplemented in CCPhysicsSprite.

bool isFlipX ( void  )

Returns the flag which indicates whether the sprite is flipped horizontally or not.

It only flips the texture of the sprite, and not the texture of the sprite's children. Also, flipping the texture doesn't alter the anchorPoint. If you want to flip the anchorPoint too, and/or to flip the children too use: sprite->setScaleX(sprite->getScaleX() * -1);

Returns
true if the sprite is flipped horizaontally, false otherwise.
var isFlippedX (   )

Returns the flag which indicates whether the sprite is flipped horizontally or not.

It only flips the texture of the sprite, and not the texture of the sprite's children. Also, flipping the texture doesn't alter the anchorPoint. If you want to flip the anchorPoint too, and/or to flip the children too use: sprite->setScaleX(sprite->getScaleX() * -1);

Returns
true if the sprite is flipped horizaontally, false otherwise.
local isFlipX (   )

Returns the flag which indicates whether the sprite is flipped horizontally or not.

It only flips the texture of the sprite, and not the texture of the sprite's children. Also, flipping the texture doesn't alter the anchorPoint. If you want to flip the anchorPoint too, and/or to flip the children too use: sprite->setScaleX(sprite->getScaleX() * -1);

Returns
true if the sprite is flipped horizaontally, false otherwise.
bool isFlipY ( void  )

Return the flag which indicates whether the sprite is flipped vertically or not.

It only flips the texture of the sprite, and not the texture of the sprite's children. Also, flipping the texture doesn't alter the anchorPoint. If you want to flip the anchorPoint too, and/or to flip the children too use: sprite->setScaleY(sprite->getScaleY() * -1);

Returns
true if the sprite is flipped vertically, flase otherwise.
var isFlippedY (   )

Return the flag which indicates whether the sprite is flipped vertically or not.

It only flips the texture of the sprite, and not the texture of the sprite's children. Also, flipping the texture doesn't alter the anchorPoint. If you want to flip the anchorPoint too, and/or to flip the children too use: sprite->setScaleY(sprite->getScaleY() * -1);

Returns
true if the sprite is flipped vertically, flase otherwise.
local isFlipY (   )

Return the flag which indicates whether the sprite is flipped vertically or not.

It only flips the texture of the sprite, and not the texture of the sprite's children. Also, flipping the texture doesn't alter the anchorPoint. If you want to flip the anchorPoint too, and/or to flip the children too use: sprite->setScaleY(sprite->getScaleY() * -1);

Returns
true if the sprite is flipped vertically, flase otherwise.
virtual bool isFrameDisplayed ( CCSpriteFrame pFrame)
virtual

Returns whether or not a CCSpriteFrame is being displayed.

var isFrameDisplayed ( var  pFrame)
virtual

Returns whether or not a CCSpriteFrame is being displayed.

local isFrameDisplayed ( local  pFrame)
virtual

Returns whether or not a CCSpriteFrame is being displayed.

virtual bool isOpacityModifyRGB ( void  )
virtual

Returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity)

Returns
Returns opacity modify flag.

Reimplemented from CCNodeRGBA.

var isOpacityModifyRGB (   )
virtual

Returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity)

Returns
Returns opacity modify flag.

Reimplemented from CCNodeRGBA.

local isOpacityModifyRGB (   )
virtual

Returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity)

Returns
Returns opacity modify flag.

Reimplemented from CCNodeRGBA.

bool isTextureRectRotated ( void  )
inline

Returns whether or not the texture rectangle is rotated.

var isTextureRectRotated (   )
inline

Returns whether or not the texture rectangle is rotated.

local isTextureRectRotated (   )
inline

Returns whether or not the texture rectangle is rotated.

virtual void
removeAllChildrenWithCleanup
( bool  cleanup)
virtual

Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.

Parameters
cleanuptrue if all running actions on all children nodes should be cleanup, false oterwise.

Reimplemented from CCNode.

var removeAllChildrenWithCleanup ( var  cleanup)
virtual

Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.

Parameters
cleanuptrue if all running actions on all children nodes should be cleanup, false oterwise.

Reimplemented from CCNode.

local removeAllChildrenWithCleanup ( local  cleanup)
virtual

Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter.

Parameters
cleanuptrue if all running actions on all children nodes should be cleanup, false oterwise.

Reimplemented from CCNode.

virtual void removeChild ( CCNode child,
bool  cleanup 
)
virtual

Removes a child from the container.

It will also cleanup all running actions depending on the cleanup parameter.

Parameters
childThe child node which will be removed.
cleanuptrue if all running actions and callbacks on the child node will be cleanup, false otherwise.

Reimplemented from CCNode.

var removeChild ( var  child,
var  cleanup 
)
virtual

Removes a child from the container.

It will also cleanup all running actions depending on the cleanup parameter.

Parameters
childThe child node which will be removed.
cleanuptrue if all running actions and callbacks on the child node will be cleanup, false otherwise.

Reimplemented from CCNode.

local removeChild ( local  child,
local  cleanup 
)
virtual

Removes a child from the container.

It will also cleanup all running actions depending on the cleanup parameter.

Parameters
childThe child node which will be removed.
cleanuptrue if all running actions and callbacks on the child node will be cleanup, false otherwise.

Reimplemented from CCNode.

virtual void reorderChild ( CCNode child,
int  zOrder 
)
virtual

Reorders a child according to a new z value.

Parameters
childAn already added child node. It MUST be already added.
zOrderZ order for drawing priority. Please refer to setZOrder(int)

Reimplemented from CCNode.

var reorderChild ( var  child,
var  zOrder 
)
virtual

Reorders a child according to a new z value.

Parameters
childAn already added child node. It MUST be already added.
zOrderZ order for drawing priority. Please refer to setZOrder(int)

Reimplemented from CCNode.

local reorderChild ( local  child,
local  zOrder 
)
virtual

Reorders a child according to a new z value.

Parameters
childAn already added child node. It MUST be already added.
zOrderZ order for drawing priority. Please refer to setZOrder(int)

Reimplemented from CCNode.

virtual void setAnchorPoint ( const CCPoint anchorPoint)
virtual

Sets the anchor point in percent.

anchorPoint is the point around which all transformations and positioning manipulations take place. It's like a pin in the node where it is "attached" to its parent. The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner. But you can use values higher than (1,1) and lower than (0,0) too. The default anchorPoint is (0.5,0.5), so it starts in the center of the node.

Parameters
anchorPointThe anchor point of node.

Reimplemented from CCNode.

var setAnchorPoint ( var  anchorPoint)
virtual

Sets the anchor point in percent.

anchorPoint is the point around which all transformations and positioning manipulations take place. It's like a pin in the node where it is "attached" to its parent. The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner. But you can use values higher than (1,1) and lower than (0,0) too. The default anchorPoint is (0.5,0.5), so it starts in the center of the node.

Parameters
anchorPointThe anchor point of node.

Reimplemented from CCNode.

local setAnchorPoint ( local  anchorPoint)
virtual

Sets the anchor point in percent.

anchorPoint is the point around which all transformations and positioning manipulations take place. It's like a pin in the node where it is "attached" to its parent. The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner. But you can use values higher than (1,1) and lower than (0,0) too. The default anchorPoint is (0.5,0.5), so it starts in the center of the node.

Parameters
anchorPointThe anchor point of node.

Reimplemented from CCNode.

void setAtlasIndex ( unsigned int  uAtlasIndex)
inline

Sets the index used on the TextureAtlas.

Warning
Don't modify this value unless you know what you are doing
var setAtlasIndex ( var  uAtlasIndex)
inline

Sets the index used on the TextureAtlas.

Warning
Don't modify this value unless you know what you are doing
local setAtlasIndex ( local  uAtlasIndex)
inline

Sets the index used on the TextureAtlas.

Warning
Don't modify this value unless you know what you are doing
virtual void setBatchNode ( CCSpriteBatchNode pobSpriteBatchNode)
virtual

Sets the batch node to sprite.

Warning
This method is not recommended for game developers. Sample code for using batch node
CCSpriteBatchNode *batch = CCSpriteBatchNode::create("Images/grossini_dance_atlas.png", 15);
CCSprite *sprite = CCSprite::createWithTexture(batch->getTexture(), CCRectMake(0, 0, 57, 57));
batch->addChild(sprite);
layer->addChild(batch);
var setBatchNode ( var  pobSpriteBatchNode)
virtual

Sets the batch node to sprite.

Warning
This method is not recommended for game developers. Sample code for using batch node
CCSpriteBatchNode *batch = CCSpriteBatchNode::create("Images/grossini_dance_atlas.png", 15);
CCSprite *sprite = CCSprite::createWithTexture(batch->getTexture(), CCRectMake(0, 0, 57, 57));
batch->addChild(sprite);
layer->addChild(batch);
local setBatchNode ( local  pobSpriteBatchNode)
virtual

Sets the batch node to sprite.

Warning
This method is not recommended for game developers. Sample code for using batch node
CCSpriteBatchNode *batch = CCSpriteBatchNode::create("Images/grossini_dance_atlas.png", 15);
CCSprite *sprite = CCSprite::createWithTexture(batch->getTexture(), CCRectMake(0, 0, 57, 57));
batch->addChild(sprite);
layer->addChild(batch);
void setBlendFunc ( ccBlendFunc  blendFunc)
inlinevirtual

Sets the source blending function.

Parameters
blendFuncA structure with source and destination factor to specify pixel arithmetic, e.g. {GL_ONE, GL_ONE}, {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}.

Implements CCBlendProtocol.

var setBlendFunc ( var  blendFunc)
inlinevirtual

Sets the source blending function.

Parameters
blendFuncA structure with source and destination factor to specify pixel arithmetic, e.g. {GL_ONE, GL_ONE}, {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}.

Implements CCBlendProtocol.

local setBlendFunc ( local  blendFunc)
inlinevirtual

Sets the source blending function.

Parameters
blendFuncA structure with source and destination factor to specify pixel arithmetic, e.g. {GL_ONE, GL_ONE}, {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}.

Implements CCBlendProtocol.

virtual void setColor ( const ccColor3B color)
virtual

@

Reimplemented from CCNodeRGBA.

var setColor ( var  color)
virtual

@

Reimplemented from CCNodeRGBA.

local setColor ( local  color)
virtual

@

Reimplemented from CCNodeRGBA.

virtual void setDirty ( bool  bDirty)
inlinevirtual

Makes the Sprite to be updated in the Atlas.

var setDirty ( var  bDirty)
inlinevirtual

Makes the Sprite to be updated in the Atlas.

local setDirty ( local  bDirty)
inlinevirtual

Makes the Sprite to be updated in the Atlas.

virtual void setDirtyRecursively ( bool  bValue)
protectedvirtual
var setDirtyRecursively ( var  bValue)
protectedvirtual
local setDirtyRecursively ( local  bValue)
protectedvirtual
virtual void setDisplayFrame ( CCSpriteFrame pNewFrame)
virtual

Sets a new display frame to the CCSprite.

var setDisplayFrame ( var  pNewFrame)
virtual

Sets a new display frame to the CCSprite.

local setDisplayFrame ( local  pNewFrame)
virtual

Sets a new display frame to the CCSprite.

virtual void
setDisplayFrameWithAnimationName
( const char *  animationName,
int  frameIndex 
)
virtual

Changes the display frame with animation name and index.

The animation name will be get from the CCAnimationCache

var
setDisplayFrameWithAnimationName
( var  animationName,
var  frameIndex 
)
virtual

Changes the display frame with animation name and index.

The animation name will be get from the CCAnimationCache

local
setDisplayFrameWithAnimationName
( local  animationName,
local  frameIndex 
)
virtual

Changes the display frame with animation name and index.

The animation name will be get from the CCAnimationCache

void setFlipX ( bool  bFlipX)

Sets whether the sprite should be flipped horizontally or not.

Parameters
bFlipXtrue if the sprite should be flipped horizaontally, false otherwise.
var setFlipX ( var  bFlipX)

Sets whether the sprite should be flipped horizontally or not.

Parameters
bFlipXtrue if the sprite should be flipped horizaontally, false otherwise.
local setFlipX ( local  bFlipX)

Sets whether the sprite should be flipped horizontally or not.

Parameters
bFlipXtrue if the sprite should be flipped horizaontally, false otherwise.
void setFlipY ( bool  bFlipY)

Sets whether the sprite should be flipped vertically or not.

Parameters
bFlipYtrue if the sprite should be flipped vertically, flase otherwise.
var setFlipY ( var  bFlipY)

Sets whether the sprite should be flipped vertically or not.

Parameters
bFlipYtrue if the sprite should be flipped vertically, flase otherwise.
local setFlipY ( local  bFlipY)

Sets whether the sprite should be flipped vertically or not.

Parameters
bFlipYtrue if the sprite should be flipped vertically, flase otherwise.
virtual void setOpacity ( GLubyte  opacity)
virtual

Changes the opacity.

Parameters
valueGoes from 0 to 255, where 255 means fully opaque and 0 means fully transparent.

Reimplemented from CCNodeRGBA.

var setOpacity ( var  opacity)
virtual

Changes the opacity.

Parameters
valueGoes from 0 to 255, where 255 means fully opaque and 0 means fully transparent.

Reimplemented from CCNodeRGBA.

local setOpacity ( local  opacity)
virtual

Changes the opacity.

Parameters
valueGoes from 0 to 255, where 255 means fully opaque and 0 means fully transparent.

Reimplemented from CCNodeRGBA.

virtual void setOpacityModifyRGB ( bool  bValue)
virtual

Changes the OpacityModifyRGB property.

If thie property is set to true, then the rendered color will be affected by opacity. Normally, r = r * opacity/255, g = g * opacity/255, b = b * opacity/255.

Parameters
bValuetrue then the opacity will be applied as: glColor(R,G,B,opacity); false then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);

Reimplemented from CCNodeRGBA.

var setOpacityModifyRGB ( var  bValue)
virtual

Changes the OpacityModifyRGB property.

If thie property is set to true, then the rendered color will be affected by opacity. Normally, r = r * opacity/255, g = g * opacity/255, b = b * opacity/255.

Parameters
bValuetrue then the opacity will be applied as: glColor(R,G,B,opacity); false then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);

Reimplemented from CCNodeRGBA.

local setOpacityModifyRGB ( local  bValue)
virtual

Changes the OpacityModifyRGB property.

If thie property is set to true, then the rendered color will be affected by opacity. Normally, r = r * opacity/255, g = g * opacity/255, b = b * opacity/255.

Parameters
bValuetrue then the opacity will be applied as: glColor(R,G,B,opacity); false then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);

Reimplemented from CCNodeRGBA.

virtual void setPosition ( const CCPoint position)
virtual

Changes the position (x,y) of the node in OpenGL coordinates.

Usually we use ccp(x,y) to compose CCPoint object. The original point (0,0) is at the left-bottom corner of screen. For example, this codesnip sets the node in the center of screen.

node->setPosition( ccp(size.width/2, size.height/2) )
Parameters
positionThe position (x,y) of the node in OpenGL coordinates

Reimplemented from CCNode.

Reimplemented in CCPhysicsSprite.

var setPosition ( var  position)
virtual

Changes the position (x,y) of the node in OpenGL coordinates.

Usually we use ccp(x,y) to compose CCPoint object. The original point (0,0) is at the left-bottom corner of screen. For example, this codesnip sets the node in the center of screen.

node->setPosition( ccp(size.width/2, size.height/2) )
Parameters
positionThe position (x,y) of the node in OpenGL coordinates

Reimplemented from CCNode.

Reimplemented in CCPhysicsSprite.

virtual void
setReorderChildDirtyRecursively
( void  )
protectedvirtual
var setReorderChildDirtyRecursively (   )
protectedvirtual
local
setReorderChildDirtyRecursively
(   )
protectedvirtual
virtual void setRotation ( float  fRotation)
virtual

Sets the rotation (angle) of the node in degrees.

0 is the default rotation angle. Positive values rotate node clockwise, and negative values for anti-clockwise.

Parameters
fRotationThe roration of the node in degrees.

Reimplemented from CCNode.

Reimplemented in CCPhysicsSprite.

var setRotation ( var  fRotation)
virtual

Sets the rotation (angle) of the node in degrees.

0 is the default rotation angle. Positive values rotate node clockwise, and negative values for anti-clockwise.

Parameters
fRotationThe roration of the node in degrees.

Reimplemented from CCNode.

Reimplemented in CCPhysicsSprite.

local setRotation ( local  fRotation)
virtual

Sets the rotation (angle) of the node in degrees.

0 is the default rotation angle. Positive values rotate node clockwise, and negative values for anti-clockwise.

Parameters
fRotationThe roration of the node in degrees.

Reimplemented from CCNode.

Reimplemented in CCPhysicsSprite.

virtual void setRotationX ( float  fRotaionX)
virtual

Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew.

0 is the default rotation angle. Positive values rotate node clockwise, and negative values for anti-clockwise.

Parameters
fRotationXThe X rotation in degrees which performs a horizontal rotational skew.

Reimplemented from CCNode.

var setRotationX ( var  fRotaionX)
virtual

Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew.

0 is the default rotation angle. Positive values rotate node clockwise, and negative values for anti-clockwise.

Parameters
fRotationXThe X rotation in degrees which performs a horizontal rotational skew.

Reimplemented from CCNode.

local setRotationX ( local  fRotaionX)
virtual

Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew.

0 is the default rotation angle. Positive values rotate node clockwise, and negative values for anti-clockwise.

Parameters
fRotationXThe X rotation in degrees which performs a horizontal rotational skew.

Reimplemented from CCNode.

virtual void setRotationY ( float  fRotationY)
virtual

Sets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew.

0 is the default rotation angle. Positive values rotate node clockwise, and negative values for anti-clockwise.

Parameters
fRotationYThe Y rotation in degrees.

Reimplemented from CCNode.

var setRotationY ( var  fRotationY)
virtual

Sets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew.

0 is the default rotation angle. Positive values rotate node clockwise, and negative values for anti-clockwise.

Parameters
fRotationYThe Y rotation in degrees.

Reimplemented from CCNode.

local setRotationY ( local  fRotationY)
virtual

Sets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew.

0 is the default rotation angle. Positive values rotate node clockwise, and negative values for anti-clockwise.

Parameters
fRotationYThe Y rotation in degrees.

Reimplemented from CCNode.

virtual void setScale ( float  scale)
virtual

Changes both X and Y scale factor of the node.

1.0 is the default scale factor. It modifies the X and Y scale at the same time.

Parameters
scaleThe scale factor for both X and Y axis.

Reimplemented from CCNode.

var setScale ( var  scale)
virtual

Changes both X and Y scale factor of the node.

1.0 is the default scale factor. It modifies the X and Y scale at the same time.

Parameters
scaleThe scale factor for both X and Y axis.

Reimplemented from CCNode.

local setScale ( local  scale)
virtual

Changes both X and Y scale factor of the node.

1.0 is the default scale factor. It modifies the X and Y scale at the same time.

Parameters
scaleThe scale factor for both X and Y axis.

Reimplemented from CCNode.

virtual void setScaleX ( float  fScaleX)
virtual

Changes the scale factor on X axis of this node.

The deafult value is 1.0 if you haven't changed it before

Parameters
fScaleXThe scale factor on X axis.

Reimplemented from CCNode.

var setScaleX ( var  fScaleX)
virtual

Changes the scale factor on X axis of this node.

The deafult value is 1.0 if you haven't changed it before

Parameters
fScaleXThe scale factor on X axis.

Reimplemented from CCNode.

local setScaleX ( local  fScaleX)
virtual

Changes the scale factor on X axis of this node.

The deafult value is 1.0 if you haven't changed it before

Parameters
fScaleXThe scale factor on X axis.

Reimplemented from CCNode.

virtual void setScaleY ( float  fScaleY)
virtual

Changes the scale factor on Y axis of this node.

The Default value is 1.0 if you haven't changed it before.

Parameters
fScaleYThe scale factor on Y axis.

Reimplemented from CCNode.

var setScaleY ( var  fScaleY)
virtual

Changes the scale factor on Y axis of this node.

The Default value is 1.0 if you haven't changed it before.

Parameters
fScaleYThe scale factor on Y axis.

Reimplemented from CCNode.

local setScaleY ( local  fScaleY)
virtual

Changes the scale factor on Y axis of this node.

The Default value is 1.0 if you haven't changed it before.

Parameters
fScaleYThe scale factor on Y axis.

Reimplemented from CCNode.

virtual void setSkewX ( float  fSkewX)
virtual

Changes the X skew angle of the node in degrees.

This angle describes the shear distortion in the X direction. Thus, it is the angle between the Y axis and the left edge of the shape The default skewX angle is 0. Positive values distort the node in a CW direction.

Parameters
fSkewXThe X skew angle of the node in degrees.

Reimplemented from CCNode.

var setSkewX ( var  fSkewX)
virtual

Changes the X skew angle of the node in degrees.

This angle describes the shear distortion in the X direction. Thus, it is the angle between the Y axis and the left edge of the shape The default skewX angle is 0. Positive values distort the node in a CW direction.

Parameters
fSkewXThe X skew angle of the node in degrees.

Reimplemented from CCNode.

local setSkewX ( local  fSkewX)
virtual

Changes the X skew angle of the node in degrees.

This angle describes the shear distortion in the X direction. Thus, it is the angle between the Y axis and the left edge of the shape The default skewX angle is 0. Positive values distort the node in a CW direction.

Parameters
fSkewXThe X skew angle of the node in degrees.

Reimplemented from CCNode.

virtual void setSkewY ( float  fSkewY)
virtual

Changes the Y skew angle of the node in degrees.

This angle describes the shear distortion in the Y direction. Thus, it is the angle between the X axis and the bottom edge of the shape The default skewY angle is 0. Positive values distort the node in a CCW direction.

Parameters
fSkewYThe Y skew angle of the node in degrees.

Reimplemented from CCNode.

var setSkewY ( var  fSkewY)
virtual

Changes the Y skew angle of the node in degrees.

This angle describes the shear distortion in the Y direction. Thus, it is the angle between the X axis and the bottom edge of the shape The default skewY angle is 0. Positive values distort the node in a CCW direction.

Parameters
fSkewYThe Y skew angle of the node in degrees.

Reimplemented from CCNode.

local setSkewY ( local  fSkewY)
virtual

Changes the Y skew angle of the node in degrees.

This angle describes the shear distortion in the Y direction. Thus, it is the angle between the X axis and the bottom edge of the shape The default skewY angle is 0. Positive values distort the node in a CCW direction.

Parameters
fSkewYThe Y skew angle of the node in degrees.

Reimplemented from CCNode.

virtual void setTexture ( CCTexture2D texture)
virtual

Sets a new texuture.

It will be retained.

Parameters
textureA valid CCTexture2D object, which will be applied to this sprite object.

Implements CCTextureProtocol.

var setTexture ( var  texture)
virtual

Sets a new texuture.

It will be retained.

Parameters
textureA valid CCTexture2D object, which will be applied to this sprite object.

Implements CCTextureProtocol.

local setTexture ( local  texture)
virtual

Sets a new texuture.

It will be retained.

Parameters
textureA valid CCTexture2D object, which will be applied to this sprite object.

Implements CCTextureProtocol.

void setTextureAtlas ( CCTextureAtlas pobTextureAtlas)
inline

Sets the weak reference of the CCTextureAtlas when the sprite is rendered using via CCSpriteBatchNode.

var setTextureAtlas ( var  pobTextureAtlas)
inline

Sets the weak reference of the CCTextureAtlas when the sprite is rendered using via CCSpriteBatchNode.

local setTextureAtlas ( local  pobTextureAtlas)
inline

Sets the weak reference of the CCTextureAtlas when the sprite is rendered using via CCSpriteBatchNode.

virtual void setTextureCoords ( CCRect  rect)
protectedvirtual
var setTextureCoords ( var  rect)
protectedvirtual
local setTextureCoords ( local  rect)
protectedvirtual
virtual void setTextureRect ( const CCRect rect)
virtual

Updates the texture rect of the CCSprite in points.

It will call setTextureRect:rotated:untrimmedSize with rotated = NO, and utrimmedSize = rect.size.

var setTextureRect ( var  rect)
virtual

Updates the texture rect of the CCSprite in points.

It will call setTextureRect:rotated:untrimmedSize with rotated = NO, and utrimmedSize = rect.size.

local setTextureRect ( local  rect)
virtual

Updates the texture rect of the CCSprite in points.

It will call setTextureRect:rotated:untrimmedSize with rotated = NO, and utrimmedSize = rect.size.

virtual void setTextureRect ( const CCRect rect,
bool  rotated,
const CCSize untrimmedSize 
)
virtual

Sets the texture rect, rectRotated and untrimmed size of the CCSprite in points.

It will update the texture coordinates and the vertex rectangle.

var setTextureRect ( var  rect,
var  rotated,
var  untrimmedSize 
)
virtual

Sets the texture rect, rectRotated and untrimmed size of the CCSprite in points.

It will update the texture coordinates and the vertex rectangle.

local setTextureRect ( local  rect,
local  rotated,
local  untrimmedSize 
)
virtual

Sets the texture rect, rectRotated and untrimmed size of the CCSprite in points.

It will update the texture coordinates and the vertex rectangle.

virtual void setVertexRect ( const CCRect rect)
virtual

Sets the vertex rect.

It will be called internally by setTextureRect. Useful if you want to create 2x images from SD images in Retina Display. Do not call it manually. Use setTextureRect instead.

var setVertexRect ( var  rect)
virtual

Sets the vertex rect.

It will be called internally by setTextureRect. Useful if you want to create 2x images from SD images in Retina Display. Do not call it manually. Use setTextureRect instead.

local setVertexRect ( local  rect)
virtual

Sets the vertex rect.

It will be called internally by setTextureRect. Useful if you want to create 2x images from SD images in Retina Display. Do not call it manually. Use setTextureRect instead.

virtual void setVertexZ ( float  vertexZ)
virtual

Sets the real OpenGL Z vertex.

Differences between openGL Z vertex and cocos2d Z order:

  • OpenGL Z modifies the Z vertex, and not the Z order in the relation between parent-children
  • OpenGL Z might require to set 2D projection
  • cocos2d Z order works OK if all the nodes uses the same openGL Z vertex. eg: vertexZ = 0
Warning
Use it at your own risk since it might break the cocos2d parent-children z order
Parameters
fVertexZOpenGL Z vertex of this node.

Reimplemented from CCNode.

var setVertexZ ( var  vertexZ)
virtual

Sets the real OpenGL Z vertex.

Differences between openGL Z vertex and cocos2d Z order:

  • OpenGL Z modifies the Z vertex, and not the Z order in the relation between parent-children
  • OpenGL Z might require to set 2D projection
  • cocos2d Z order works OK if all the nodes uses the same openGL Z vertex. eg: vertexZ = 0
Warning
Use it at your own risk since it might break the cocos2d parent-children z order
Parameters
fVertexZOpenGL Z vertex of this node.

Reimplemented from CCNode.

local setVertexZ ( local  vertexZ)
virtual

Sets the real OpenGL Z vertex.

Differences between openGL Z vertex and cocos2d Z order:

  • OpenGL Z modifies the Z vertex, and not the Z order in the relation between parent-children
  • OpenGL Z might require to set 2D projection
  • cocos2d Z order works OK if all the nodes uses the same openGL Z vertex. eg: vertexZ = 0
Warning
Use it at your own risk since it might break the cocos2d parent-children z order
Parameters
fVertexZOpenGL Z vertex of this node.

Reimplemented from CCNode.

virtual void setVisible ( bool  visible)
virtual

Sets whether the node is visible.

The default value is true, a node is default to visible

Parameters
visibletrue if the node is visible, false if the node is hidden.

Reimplemented from CCNode.

var setVisible ( var  visible)
virtual

Sets whether the node is visible.

The default value is true, a node is default to visible

Parameters
visibletrue if the node is visible, false if the node is hidden.

Reimplemented from CCNode.

local setVisible ( local  visible)
virtual

Sets whether the node is visible.

The default value is true, a node is default to visible

Parameters
visibletrue if the node is visible, false if the node is hidden.

Reimplemented from CCNode.

virtual void sortAllChildren ( )
virtual

Sorts the children array once before drawing, instead of every time when a child is added or reordered.

This appraoch can improves the performance massively.

Note
Don't call this manually unless a child added needs to be removed in the same frame

Reimplemented from CCNode.

var sortAllChildren ( )
virtual

Sorts the children array once before drawing, instead of every time when a child is added or reordered.

This appraoch can improves the performance massively.

Note
Don't call this manually unless a child added needs to be removed in the same frame

Reimplemented from CCNode.

local sortAllChildren ( )
virtual

Sorts the children array once before drawing, instead of every time when a child is added or reordered.

This appraoch can improves the performance massively.

Note
Don't call this manually unless a child added needs to be removed in the same frame

Reimplemented from CCNode.

virtual void updateBlendFunc ( void  )
protectedvirtual
var updateBlendFunc (   )
protectedvirtual
local updateBlendFunc (   )
protectedvirtual
void updateColor ( void  )
protected
var updateColor (   )
protected
local updateColor (   )
protected
virtual void updateDisplayedColor ( const ccColor3B color)
virtual

recursive method that updates display color

Reimplemented from CCNodeRGBA.

var updateDisplayedColor ( var  color)
virtual

recursive method that updates display color

Reimplemented from CCNodeRGBA.

local updateDisplayedColor ( local  color)
virtual

recursive method that updates display color

Reimplemented from CCNodeRGBA.

virtual void updateDisplayedOpacity ( GLubyte  opacity)
virtual

recursive method that updates the displayed opacity.

Reimplemented from CCNodeRGBA.

var updateDisplayedOpacity ( var  opacity)
virtual

recursive method that updates the displayed opacity.

Reimplemented from CCNodeRGBA.

local updateDisplayedOpacity ( local  opacity)
virtual

recursive method that updates the displayed opacity.

Reimplemented from CCNodeRGBA.

virtual void updateTransform ( void  )
virtual

Updates the quad according the rotation, position, scale values.

Reimplemented from CCNode.

Reimplemented in CCSkin.

var updateTransform (   )
virtual

Updates the quad according the rotation, position, scale values.

Reimplemented from CCNode.

Reimplemented in CCSkin.

local updateTransform (   )
virtual

Updates the quad according the rotation, position, scale values.

Reimplemented from CCNode.

Reimplemented in CCSkin.

Variable Documentation

bool m_bDirty
protected

Used batch node (weak reference)

var m_bDirty
protected

Used batch node (weak reference)

local m_bDirty
protected

Used batch node (weak reference)

bool m_bFlipX
protected
var m_bFlipX
protected
local m_bFlipX
protected
bool m_bFlipY
protected

Whether the sprite is flipped horizaontally or not.

var m_bFlipY
protected

Whether the sprite is flipped horizaontally or not.

local m_bFlipY
protected

Whether the sprite is flipped horizaontally or not.

bool m_bHasChildren
protected

Whether all of the sprite's children needs to be updated.

var m_bHasChildren
protected

Whether all of the sprite's children needs to be updated.

local m_bHasChildren
protected

Whether all of the sprite's children needs to be updated.

bool m_bOpacityModifyRGB
protected
var m_bOpacityModifyRGB
protected
local m_bOpacityModifyRGB
protected
bool m_bRectRotated
protected

Retangle of CCTexture2D.

var m_bRectRotated
protected

Retangle of CCTexture2D.

local m_bRectRotated
protected

Retangle of CCTexture2D.

bool m_bRecursiveDirty
protected

Whether the sprite needs to be updated.

var m_bRecursiveDirty
protected

Whether the sprite needs to be updated.

local m_bRecursiveDirty
protected

Whether the sprite needs to be updated.

bool m_bShouldBeHidden
protected

Whether the sprite contains children.

var m_bShouldBeHidden
protected

Whether the sprite contains children.

local m_bShouldBeHidden
protected

Whether the sprite contains children.

CCPoint m_obOffsetPosition
protected

Whether the texture is rotated.

var m_obOffsetPosition
protected

Whether the texture is rotated.

local m_obOffsetPosition
protected

Whether the texture is rotated.

CCRect m_obRect
protected

CCTexture2D object that is used to render the sprite.

var m_obRect
protected

CCTexture2D object that is used to render the sprite.

local m_obRect
protected

CCTexture2D object that is used to render the sprite.

CCPoint
m_obUnflippedOffsetPositionFromCenter
protected
var
m_obUnflippedOffsetPositionFromCenter
protected
local
m_obUnflippedOffsetPositionFromCenter
protected
CCSpriteBatchNode* m_pobBatchNode
protected

Absolute (real) Index on the SpriteSheet.

var m_pobBatchNode
protected

Absolute (real) Index on the SpriteSheet.

local m_pobBatchNode
protected

Absolute (real) Index on the SpriteSheet.

CCTexture2D* m_pobTexture
protected

It's required for CCTextureProtocol inheritance.

var m_pobTexture
protected

It's required for CCTextureProtocol inheritance.

local m_pobTexture
protected

It's required for CCTextureProtocol inheritance.

CCTextureAtlas* m_pobTextureAtlas
protected
ccBlendFunc m_sBlendFunc
protected
var m_sBlendFunc
protected
local m_sBlendFunc
protected
ccV3F_C4B_T2F_Quad m_sQuad
protected
var m_sQuad
protected
local m_sQuad
protected
CCAffineTransform
m_transformToBatch
protected

should not be drawn because one of the ancestors is not visible

var m_transformToBatch
protected

should not be drawn because one of the ancestors is not visible

local m_transformToBatch
protected

should not be drawn because one of the ancestors is not visible

unsigned int m_uAtlasIndex
protected

CCSpriteBatchNode texture atlas (weak reference)

var m_uAtlasIndex
protected

CCSpriteBatchNode texture atlas (weak reference)

local m_uAtlasIndex
protected

CCSpriteBatchNode texture atlas (weak reference)