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

Classes

class  AnimationFrame
 AnimationFrame A frame of the animation. More...
 
class  Animation
 A Animation object is used to perform animations on the Sprite objects. More...
 
class  AnimationCache
 Singleton that manages the Animations. More...
 
class  Sprite
 Sprite is a 2d image ( http://en.wikipedia.org/wiki/Sprite_(computer_graphics) ) More...
 
class  SpriteBatchNode
 SpriteBatchNode 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  SpriteFrame
 A SpriteFrame has: More...
 
class  SpriteFrameCache
 Singleton that handles the loading of the sprite frames. More...
 

Functions

CC_DEPRECATED_ATTRIBUTE bool isFlipY ()
local isFlipY ()
CC_DEPRECATED_ATTRIBUTE void setFlipY (bool flippedY)
local setFlipY ( local flippedY)
void updateColor (void)
virtual void setTextureCoords (Rect rect)
local setTextureCoords ( local rect)
virtual void updateBlendFunc (void)
virtual void setReorderChildDirtyRecursively (void)
local setReorderChildDirtyRecursively ()
virtual void setDirtyRecursively (bool bValue)

Variables

TextureAtlas * _textureAtlas
int _atlasIndex
 SpriteBatchNode texture atlas (weak reference) More...
 
var _atlasIndex
 SpriteBatchNode texture atlas (weak reference) More...
 
local _atlasIndex
 SpriteBatchNode texture atlas (weak reference) More...
 
SpriteBatchNode * _batchNode
 Absolute (real) Index on the SpriteSheet. More...
 
var _batchNode
 Absolute (real) Index on the SpriteSheet. More...
 
local _batchNode
 Absolute (real) Index on the SpriteSheet. More...
 
bool _dirty
 Used batch node (weak reference) More...
 
bool _recursiveDirty
 Whether the sprite needs to be updated. More...
 
var _recursiveDirty
 Whether the sprite needs to be updated. More...
 
local _recursiveDirty
 Whether the sprite needs to be updated. More...
 
bool _hasChildren
 Whether all of the sprite's children needs to be updated. More...
 
bool _shouldBeHidden
 Whether the sprite contains children. More...
 
var _shouldBeHidden
 Whether the sprite contains children. More...
 
local _shouldBeHidden
 Whether the sprite contains children. More...
 
AffineTransform _transformToBatch
 should not be drawn because one of the ancestors is not visible More...
 
var _transformToBatch
 should not be drawn because one of the ancestors is not visible More...
 
local _transformToBatch
 should not be drawn because one of the ancestors is not visible More...
 
BlendFunc _blendFunc
Texture2D * _texture
 It's required for TextureProtocol inheritance. More...
 
var _texture
 It's required for TextureProtocol inheritance. More...
 
local _texture
 It's required for TextureProtocol inheritance. More...
 
Rect _rect
 Texture2D object that is used to render the sprite. More...
 
bool _rectRotated
 Retangle of Texture2D. More...
 
Point _offsetPosition
 Whether the texture is rotated. More...
 
var _offsetPosition
 Whether the texture is rotated. More...
 
local _offsetPosition
 Whether the texture is rotated. More...
 
Point _unflippedOffsetPositionFromCenter
var _unflippedOffsetPositionFromCenter
local _unflippedOffsetPositionFromCenter
V3F_C4B_T2F_Quad _quad
bool _opacityModifyRGB
var _opacityModifyRGB
local _opacityModifyRGB
bool _flippedX
bool _flippedY
 Whether the sprite is flipped horizaontally or not. More...
 
var _flippedY
 Whether the sprite is flipped horizaontally or not. More...
 
local _flippedY
 Whether the sprite is flipped horizaontally or not. More...
 

Creators

Sprite invalid index on the SpriteBatchNode

static Sprite * create ()
 Creates an empty sprite without texture. More...
 
static Sprite * create (const char *filename)
 Creates a sprite with an image filename. More...
 
local create ( local filename)
 Creates a sprite with an image filename. More...
 
static Sprite * create (const char *filename, const Rect &rect)
 Creates a sprite with an image filename and a rect. More...
 
local create ( local filename, local rect)
 Creates a sprite with an image filename and a rect. More...
 
static Sprite * createWithTexture (Texture2D *texture)
 Creates a sprite with an exsiting texture contained in a Texture2D object After creation, the rect will be the size of the texture, and the offset will be (0,0). More...
 
local createWithTexture ( local texture)
 Creates a sprite with an exsiting texture contained in a Texture2D object After creation, the rect will be the size of the texture, and the offset will be (0,0). More...
 
static Sprite * createWithTexture (Texture2D *texture, const Rect &rect)
 Creates a sprite with a texture and a rect. More...
 
local createWithTexture ( local texture, local rect)
 Creates a sprite with a texture and a rect. More...
 
static Sprite * createWithSpriteFrame (SpriteFrame *pSpriteFrame)
 Creates a sprite with an sprite frame. More...
 
static Sprite * createWithSpriteFrameName (const char *spriteFrameName)
 Creates a sprite with an sprite frame name. More...
 
local createWithSpriteFrameName ( local spriteFrameName)
 Creates a sprite with an sprite frame name. More...
 

Initializers

 Sprite (void)
 Default constructor. More...
 
virtual ~Sprite (void)
 Default destructor. More...
 
virtual bool init (void)
 Initializes an empty sprite with nothing init. More...
 
virtual bool initWithTexture (Texture2D *texture)
 Initializes a sprite with a texture. More...
 
local initWithTexture ( local texture)
 Initializes a sprite with a texture. More...
 
virtual bool initWithTexture (Texture2D *texture, const Rect &rect)
 Initializes a sprite with a texture and a rect. More...
 
virtual bool initWithTexture (Texture2D *texture, const Rect &rect, bool rotated)
 Initializes a sprite with a texture and a rect in points, optionally rotated. More...
 
local initWithTexture ( local texture, local rect, local rotated)
 Initializes a sprite with a texture and a rect in points, optionally rotated. More...
 
virtual bool initWithSpriteFrame (SpriteFrame *pSpriteFrame)
 Initializes a sprite with an SpriteFrame. More...
 
virtual bool initWithSpriteFrameName (const char *spriteFrameName)
 Initializes a sprite with an sprite frame name. More...
 
virtual bool initWithFile (const char *filename)
 Initializes a sprite with an image filename. More...
 
var init ( var filename)
 Initializes a sprite with an image filename. More...
 
local init ( local filename)
 Initializes a sprite with an image filename. More...
 
virtual bool initWithFile (const char *filename, const Rect &rect)
 Initializes a sprite with an image filename, and a rect. More...
 

BatchNode methods

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

Texture methods

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

Frames methods

virtual void setDisplayFrame (SpriteFrame *pNewFrame)
 Sets a new display frame to the Sprite. More...
 
virtual bool isFrameDisplayed (SpriteFrame *pFrame) const
 Returns whether or not a SpriteFrame is being displayed. More...
 
var isFrameDisplayed ( var pFrame)
 Returns whether or not a SpriteFrame is being displayed. More...
 
local isFrameDisplayed ( local pFrame)
 Returns whether or not a SpriteFrame is being displayed. More...
 
virtual
CC_DEPRECATED_ATTRIBUTE
SpriteFrame * 
displayFrame ()
local displayFrame ()
virtual SpriteFrame * getDisplayFrame ()
 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...
 
var setDisplayFrameWithAnimationName ( var animationName, var 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) const
 Whether or not the Sprite needs to be updated in the Atlas. More...
 
var isDirty ()
 Whether or not the Sprite needs to be updated in the Atlas. More...
 
local isDirty ()
 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...
 
var setDirty ( var 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...
 
V3F_C4B_T2F_Quad getQuad (void) const
 Returns the quad (tex coords, vertex coords and color) information. More...
 
bool isTextureRectRotated (void) const
 Returns whether or not the texture rectangle is rotated. More...
 
local isTextureRectRotated ()
 Returns whether or not the texture rectangle is rotated. More...
 
int getAtlasIndex (void) const
 Returns the index used on the TextureAtlas. More...
 
void setAtlasIndex (int atlasIndex)
 Sets the index used on the TextureAtlas. More...
 
const Rect & getTextureRect (void)
 Returns the rect of the Sprite in points. More...
 
var getTextureRect ()
 Returns the rect of the Sprite in points. More...
 
local getTextureRect ()
 Returns the rect of the Sprite in points. More...
 
TextureAtlas * getTextureAtlas (void)
 Gets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode. More...
 
var getTextureAtlas ()
 Gets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode. More...
 
local getTextureAtlas ()
 Gets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode. More...
 
void setTextureAtlas (TextureAtlas *pobTextureAtlas)
 Sets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode. More...
 
const Point & getOffsetPosition (void) const
 Gets the offset position of the sprite. More...
 
bool isFlippedX (void) const
 Returns the flag which indicates whether the sprite is flipped horizontally or not. More...
 
void setFlippedX (bool flippedX)
 Sets whether the sprite should be flipped horizontally or not. More...
 
CC_DEPRECATED_ATTRIBUTE bool isFlipX ()
CC_DEPRECATED_ATTRIBUTE void setFlipX (bool flippedX)
local setFlipX ( local flippedX)
bool isFlippedY (void) const
 Return the flag which indicates whether the sprite is flipped vertically or not. More...
 
void setFlippedY (bool flippedY)
 Sets whether the sprite should be flipped vertically or not. More...
 

Functions inherited from TextureProtocol

virtual void setTexture (Texture2D *texture) override
 Sets a new texuture. More...
 
virtual Texture2D * getTexture () const override
 Returns the currently used texture. More...
 
local getTexture ()
 Returns the currently used texture. More...
 
void setBlendFunc (const BlendFunc &blendFunc) override
const BlendFunc & getBlendFunc () const override
 Returns the blending function that is currently being used. More...
 

Functions inherited from Node

virtual void setScaleX (float scaleX) override
 Changes the scale factor on X axis of this node. More...
 
virtual void setScaleY (float scaleY) override
 Changes the scale factor on Y axis of this node. More...
 
virtual void setPosition (const Point &pos) override
 Changes the position (x,y) of the node in OpenGL coordinates. More...
 
virtual void setRotation (float rotation) override
 Sets the rotation (angle) of the node in degrees. More...
 
virtual void setRotationX (float rotationX) override
 Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew. More...
 
virtual void setRotationY (float rotationY) override
 Sets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew. More...
 
virtual void setSkewX (float sx) override
 Changes the X skew angle of the node in degrees. More...
 
virtual void setSkewY (float sy) override
 Changes the Y skew angle of the node in degrees. More...
 
virtual void removeChild (Node *child, bool cleanup) override
 Removes a child from the container. More...
 
var removeChild ( var child, var cleanup)
 Removes a child from the container. More...
 
local removeChild ( local child, local cleanup)
 Removes a child from the container. More...
 
virtual void removeAllChildrenWithCleanup (bool cleanup) override
 Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter. More...
 
local removeAllChildrenWithCleanup ( local cleanup)
 Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter. More...
 
virtual void reorderChild (Node *child, int zOrder) override
 Reorders a child according to a new z value. More...
 
virtual void addChild (Node *child) override
 Adds a child to the container with z-order as 0. More...
 
var addChild ( var child)
 Adds a child to the container with z-order as 0. More...
 
local addChild ( local child)
 Adds a child to the container with z-order as 0. More...
 
virtual void addChild (Node *child, int zOrder) override
 Adds a child to the container with a z-order. More...
 
var addChild ( var child, var zOrder)
 Adds a child to the container with a z-order. More...
 
local addChild ( local child, local zOrder)
 Adds a child to the container with a z-order. More...
 
virtual void addChild (Node *child, int zOrder, int tag) override
 Adds a child to the container with z order and tag. More...
 
local addChild ( local child, local zOrder, local tag)
 Adds a child to the container with z order and tag. More...
 
virtual void sortAllChildren () override
 Sorts the children array once before drawing, instead of every time when a child is added or reordered. More...
 
virtual void setScale (float scale) override
 Changes both X and Y scale factor of the node. More...
 
local setScale ( local scale)
 Changes both X and Y scale factor of the node. More...
 
virtual void setVertexZ (float vertexZ) override
 Sets the real OpenGL Z vertex. More...
 
virtual void setAnchorPoint (const Point &anchor) override
 Sets the anchor point in percent. More...
 
virtual void ignoreAnchorPointForPosition (bool value) override
 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) override
 Sets whether the node is visible. More...
 
virtual void draw (void) override
 Override this method to draw your own node. More...
 

Functions inherited from NodeRGBA

virtual void setColor (const Color3B &color3) override
 Changes the color with R,G,B bytes. More...
 
virtual void updateDisplayedColor (const Color3B &parentColor) override
 recursive method that updates display color More...
 
var updateDisplayedColor ( var parentColor)
 recursive method that updates display color More...
 
local updateDisplayedColor ( local parentColor)
 recursive method that updates display color More...
 
virtual void setOpacity (GLubyte opacity) override
 Changes the opacity. More...
 
virtual void setOpacityModifyRGB (bool modify) override
 Changes the OpacityModifyRGB property. More...
 
local setOpacityModifyRGB ( local modify)
 Changes the OpacityModifyRGB property. More...
 
virtual bool isOpacityModifyRGB (void) const override
 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) override
 recursive method that updates the displayed opacity. More...
 

Detailed Description

Function Documentation

Sprite ( void  )

Default constructor.

var ctor (   )

Default constructor.

local Sprite (   )

Default constructor.

virtual ~Sprite ( void  )
virtual

Default destructor.

virtual void addChild ( Node child)
overridevirtual

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 Node.

var addChild ( var  child)
overridevirtual

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 Node.

local addChild ( local  child)
overridevirtual

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 Node.

virtual void addChild ( Node child,
int  zOrder 
)
overridevirtual

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 Node.

var addChild ( var  child,
var  zOrder 
)
overridevirtual

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 Node.

local addChild ( local  child,
local  zOrder 
)
overridevirtual

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 Node.

virtual void addChild ( Node child,
int  zOrder,
int  tag 
)
overridevirtual

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 Node.

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

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 Node.

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

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 Node.

static Sprite* 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 Sprite* create ( const char *  filename)
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
filenameThe 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  filename)
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
filenameThe 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  filename)
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
filenameThe string which indicates a path to image file, e.g., "scene1/monster.png".
Returns
A valid sprite object that is marked as autoreleased.
static Sprite* create ( const char *  filename,
const Rect rect 
)
static

Creates a sprite with an image filename and a rect.

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

Creates a sprite with an image filename and a rect.

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

Creates a sprite with an image filename and a rect.

Parameters
filenameThe string wich indicates a path to image file, e.g., "scene1/monster.png"
rectOnly the contents inside rect of filename's texture will be applied for this sprite.
Returns
A valid sprite object that is marked as autoreleased.
static Sprite*
createWithSpriteFrame
( SpriteFrame 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 Sprite*
createWithSpriteFrameName
( const char *  spriteFrameName)
static

Creates a sprite with an sprite frame name.

A SpriteFrame will be fetched from the SpriteFrameCache by spriteFrameName param. If the SpriteFrame doesn't exist it will raise an exception.

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

Creates a sprite with an sprite frame name.

A SpriteFrame will be fetched from the SpriteFrameCache by spriteFrameName param. If the SpriteFrame doesn't exist it will raise an exception.

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

Creates a sprite with an sprite frame name.

A SpriteFrame will be fetched from the SpriteFrameCache by spriteFrameName param. If the SpriteFrame doesn't exist it will raise an exception.

Parameters
spriteFrameNameA null terminated string which indicates the sprite frame name.
Returns
A valid sprite object that is marked as autoreleased.
static Sprite* createWithTexture ( Texture2D texture)
static

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

Parameters
textureA pointer to a Texture2D object.
Returns
A valid sprite object that is marked as autoreleased.
var createWithTexture ( var  texture)
static

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

Parameters
textureA pointer to a Texture2D object.
Returns
A valid sprite object that is marked as autoreleased.
local createWithTexture ( local  texture)
static

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

Parameters
textureA pointer to a Texture2D object.
Returns
A valid sprite object that is marked as autoreleased.
static Sprite* createWithTexture ( Texture2D texture,
const Rect rect 
)
static

Creates a sprite with a texture and a rect.

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

Parameters
textureA pointer to an existing Texture2D object. You can use a Texture2D 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  texture,
var  rect 
)
static

Creates a sprite with a texture and a rect.

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

Parameters
textureA pointer to an existing Texture2D object. You can use a Texture2D 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  texture,
local  rect 
)
static

Creates a sprite with a texture and a rect.

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

Parameters
textureA pointer to an existing Texture2D object. You can use a Texture2D 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
CC_DEPRECATED_ATTRIBUTE
SpriteFrame* displayFrame
( )
inlinevirtual
var displayFrame ( )
inlinevirtual
local displayFrame ( )
inlinevirtual
virtual void draw ( void  )
overridevirtual

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 Node.

Reimplemented in TextFieldTTF.

var draw (   )
overridevirtual

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 Node.

Reimplemented in TextFieldTTF.

local draw (   )
overridevirtual

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 Node.

Reimplemented in TextFieldTTF.

int getAtlasIndex ( void  ) const
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 SpriteBatchNode*
getBatchNode
( void  )
virtual

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

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

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

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

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

Returns
The SpriteBatchNode object if this sprite is rendered by SpriteBatchNode, NULL if the sprite isn't used batch node.
const BlendFunc& getBlendFunc ( ) const
inlineoverridevirtual

Returns the blending function that is currently being used.

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

Implements BlendProtocol.

virtual SpriteFrame*
getDisplayFrame
( )
virtual

Returns the current displayed frame.

var getDisplayFrame ( )
virtual

Returns the current displayed frame.

local getDisplayFrame ( )
virtual

Returns the current displayed frame.

const Point& getOffsetPosition ( void  ) const
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.

V3F_C4B_T2F_Quad getQuad ( void  ) const
inline

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

virtual Texture2D* getTexture ( ) const
overridevirtual

Returns the currently used texture.

Returns
The texture that is currenlty being used.

Implements TextureProtocol.

var getTexture ( )
overridevirtual

Returns the currently used texture.

Returns
The texture that is currenlty being used.

Implements TextureProtocol.

local getTexture ( )
overridevirtual

Returns the currently used texture.

Returns
The texture that is currenlty being used.

Implements TextureProtocol.

TextureAtlas* getTextureAtlas ( void  )
inline

Gets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode.

var getTextureAtlas (   )
inline

Gets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode.

local getTextureAtlas (   )
inline

Gets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode.

const Rect& getTextureRect ( void  )
inline

Returns the rect of the Sprite in points.

var getTextureRect (   )
inline

Returns the rect of the Sprite in points.

local getTextureRect (   )
inline

Returns the rect of the Sprite in points.

virtual void
ignoreAnchorPointForPosition
( bool  ignore)
overridevirtual

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

This is an internal method, only used by Layer and Scene. Don't call it outside framework. The default value is false, while in Layer and Scene 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 Node.

var ignoreAnchorPointForPosition ( var  ignore)
overridevirtual

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

This is an internal method, only used by Layer and Scene. Don't call it outside framework. The default value is false, while in Layer and Scene 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 Node.

local ignoreAnchorPointForPosition ( local  ignore)
overridevirtual

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

This is an internal method, only used by Layer and Scene. Don't call it outside framework. The default value is false, while in Layer and Scene 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 Node.

virtual bool init ( void  )
virtual

Initializes an empty sprite with nothing init.

Reimplemented from NodeRGBA.

Reimplemented in LabelTTF.

var init (   )
virtual

Initializes an empty sprite with nothing init.

Reimplemented from NodeRGBA.

Reimplemented in LabelTTF.

local init (   )
virtual

Initializes an empty sprite with nothing init.

Reimplemented from NodeRGBA.

Reimplemented in LabelTTF.

virtual bool initWithFile ( const char *  filename)
virtual

Initializes a sprite with an image filename.

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

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

Reimplemented in Skin.

var init ( var  filename)
virtual

Initializes a sprite with an image filename.

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

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

Reimplemented in Skin.

local init ( local  filename)
virtual

Initializes a sprite with an image filename.

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

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

Reimplemented in Skin.

virtual bool initWithFile ( const char *  filename,
const Rect rect 
)
virtual

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

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

Parameters
filenameThe 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  filename,
var  rect 
)
virtual

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

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

Parameters
filenameThe 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 init ( local  filename,
local  rect 
)
virtual

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

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

Parameters
filenameThe 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 ( SpriteFrame pSpriteFrame)
virtual

Initializes a sprite with an SpriteFrame.

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

Parameters
pSpriteFrameA SpriteFrame 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 SpriteFrame 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 SpriteFrame 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 *  spriteFrameName)
virtual

Initializes a sprite with an sprite frame name.

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

Parameters
spriteFrameNameA key string that can fected a volid SpriteFrame from SpriteFrameCache
Returns
true if the sprite is initialized properly, false otherwise.

Reimplemented in Skin.

var initWithSpriteFrameName ( var  spriteFrameName)
virtual

Initializes a sprite with an sprite frame name.

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

Parameters
spriteFrameNameA key string that can fected a volid SpriteFrame from SpriteFrameCache
Returns
true if the sprite is initialized properly, false otherwise.

Reimplemented in Skin.

local initWithSpriteFrameName ( local  spriteFrameName)
virtual

Initializes a sprite with an sprite frame name.

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

Parameters
spriteFrameNameA key string that can fected a volid SpriteFrame from SpriteFrameCache
Returns
true if the sprite is initialized properly, false otherwise.

Reimplemented in Skin.

virtual bool initWithTexture ( Texture2D texture)
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
textureA pointer to an existing Texture2D object. You can use a Texture2D object for many sprites.
Returns
true if the sprite is initialized properly, false otherwise.
var initWithTexture ( var  texture)
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
textureA pointer to an existing Texture2D object. You can use a Texture2D object for many sprites.
Returns
true if the sprite is initialized properly, false otherwise.
local initWithTexture ( local  texture)
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
textureA pointer to an existing Texture2D object. You can use a Texture2D object for many sprites.
Returns
true if the sprite is initialized properly, false otherwise.
virtual bool initWithTexture ( Texture2D texture,
const Rect rect 
)
virtual

Initializes a sprite with a texture and a rect.

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

Parameters
textureA pointer to an exisiting Texture2D object. You can use a Texture2D 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  texture,
var  rect 
)
virtual

Initializes a sprite with a texture and a rect.

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

Parameters
textureA pointer to an exisiting Texture2D object. You can use a Texture2D 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  texture,
local  rect 
)
virtual

Initializes a sprite with a texture and a rect.

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

Parameters
textureA pointer to an exisiting Texture2D object. You can use a Texture2D 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 ( Texture2D texture,
const Rect 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
textureA Texture2D 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  texture,
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
textureA Texture2D 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  texture,
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
textureA Texture2D 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  ) const
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 PhysicsSprite.

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 PhysicsSprite.

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 PhysicsSprite.

bool isFlippedX ( void  ) const

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 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.
bool isFlippedY ( void  ) const

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 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.
CC_DEPRECATED_ATTRIBUTE bool
isFlipX
( )
inline
CC_DEPRECATED_ATTRIBUTE bool
isFlipY
( )
inline
var isFlipY ( )
inline
local isFlipY ( )
inline
virtual bool isFrameDisplayed ( SpriteFrame pFrame) const
virtual

Returns whether or not a SpriteFrame is being displayed.

var isFrameDisplayed ( var  pFrame)
virtual

Returns whether or not a SpriteFrame is being displayed.

local isFrameDisplayed ( local  pFrame)
virtual

Returns whether or not a SpriteFrame is being displayed.

virtual bool isOpacityModifyRGB ( void  ) const
overridevirtual

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 NodeRGBA.

var isOpacityModifyRGB (   )
overridevirtual

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 NodeRGBA.

local isOpacityModifyRGB (   )
overridevirtual

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 NodeRGBA.

bool isTextureRectRotated ( void  ) const
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)
overridevirtual

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 Node.

var removeAllChildrenWithCleanup ( var  cleanup)
overridevirtual

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 Node.

local removeAllChildrenWithCleanup ( local  cleanup)
overridevirtual

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 Node.

virtual void removeChild ( Node child,
bool  cleanup 
)
overridevirtual

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 Node.

var removeChild ( var  child,
var  cleanup 
)
overridevirtual

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 Node.

local removeChild ( local  child,
local  cleanup 
)
overridevirtual

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 Node.

virtual void reorderChild ( Node child,
int  zOrder 
)
overridevirtual

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 Node.

var reorderChild ( var  child,
var  zOrder 
)
overridevirtual

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 Node.

local reorderChild ( local  child,
local  zOrder 
)
overridevirtual

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 Node.

virtual void setAnchorPoint ( const Point anchorPoint)
overridevirtual

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 Node.

var setAnchorPoint ( var  anchorPoint)
overridevirtual

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 Node.

local setAnchorPoint ( local  anchorPoint)
overridevirtual

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 Node.

void setAtlasIndex ( int  atlasIndex)
inline

Sets the index used on the TextureAtlas.

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

Sets the index used on the TextureAtlas.

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

Sets the index used on the TextureAtlas.

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

Sets the batch node to sprite.

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

Sets the batch node to sprite.

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

Sets the batch node to sprite.

Warning
This method is not recommended for game developers. Sample code for using batch node
SpriteBatchNode *batch = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 15);
Sprite *sprite = Sprite::createWithTexture(batch->getTexture(), Rect(0, 0, 57, 57));
batch->addChild(sprite);
layer->addChild(batch);
void setBlendFunc ( const BlendFunc blendFunc)
inlineoverridevirtual
When this function bound into js or lua,the parameter will be changed
In js: var setBlendFunc(var src, var dst)
In lua: local setBlendFunc(local src, local dst)

Implements BlendProtocol.

var setBlendFunc ( var  blendFunc)
inlineoverridevirtual
When this function bound into js or lua,the parameter will be changed
In js: var setBlendFunc(var src, var dst)
In lua: local setBlendFunc(local src, local dst)

Implements BlendProtocol.

local setBlendFunc ( local  blendFunc)
inlineoverridevirtual
When this function bound into js or lua,the parameter will be changed
In js: var setBlendFunc(var src, var dst)
In lua: local setBlendFunc(local src, local dst)

Implements BlendProtocol.

virtual void setColor ( const Color3B color)
overridevirtual

Changes the color with R,G,B bytes.

Parameters
colorExample: Color3B(255,100,0) means R=255, G=100, B=0

Reimplemented from NodeRGBA.

var setColor ( var  color)
overridevirtual

Changes the color with R,G,B bytes.

Parameters
colorExample: Color3B(255,100,0) means R=255, G=100, B=0

Reimplemented from NodeRGBA.

local setColor ( local  color)
overridevirtual

Changes the color with R,G,B bytes.

Parameters
colorExample: Color3B(255,100,0) means R=255, G=100, B=0

Reimplemented from NodeRGBA.

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 ( SpriteFrame pNewFrame)
virtual

Sets a new display frame to the Sprite.

var setDisplayFrame ( var  pNewFrame)
virtual

Sets a new display frame to the Sprite.

local setDisplayFrame ( local  pNewFrame)
virtual

Sets a new display frame to the Sprite.

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 AnimationCache

var
setDisplayFrameWithAnimationName
( var  animationName,
var  frameIndex 
)
virtual

Changes the display frame with animation name and index.

The animation name will be get from the AnimationCache

local
setDisplayFrameWithAnimationName
( local  animationName,
local  frameIndex 
)
virtual

Changes the display frame with animation name and index.

The animation name will be get from the AnimationCache

void setFlippedX ( bool  flippedX)

Sets whether the sprite should be flipped horizontally or not.

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

Sets whether the sprite should be flipped horizontally or not.

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

Sets whether the sprite should be flipped horizontally or not.

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

Sets whether the sprite should be flipped vertically or not.

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

Sets whether the sprite should be flipped vertically or not.

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

Sets whether the sprite should be flipped vertically or not.

Parameters
bFlipYtrue if the sprite should be flipped vertically, flase otherwise.
CC_DEPRECATED_ATTRIBUTE void
setFlipX
( bool  flippedX)
inline
var setFlipX ( var  flippedX)
inline
local setFlipX ( local  flippedX)
inline
CC_DEPRECATED_ATTRIBUTE void
setFlipY
( bool  flippedY)
inline
var setFlipY ( var  flippedY)
inline
local setFlipY ( local  flippedY)
inline
virtual void setOpacity ( GLubyte  opacity)
overridevirtual

Changes the opacity.

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

Reimplemented from NodeRGBA.

var setOpacity ( var  opacity)
overridevirtual

Changes the opacity.

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

Reimplemented from NodeRGBA.

local setOpacity ( local  opacity)
overridevirtual

Changes the opacity.

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

Reimplemented from NodeRGBA.

virtual void setOpacityModifyRGB ( bool  value)
overridevirtual

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
valueIf true, then the opacity will be applied as: glColor(R,G,B,opacity); If false, then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);

Reimplemented from NodeRGBA.

var setOpacityModifyRGB ( var  value)
overridevirtual

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
valueIf true, then the opacity will be applied as: glColor(R,G,B,opacity); If false, then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);

Reimplemented from NodeRGBA.

local setOpacityModifyRGB ( local  value)
overridevirtual

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
valueIf true, then the opacity will be applied as: glColor(R,G,B,opacity); If false, then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);

Reimplemented from NodeRGBA.

virtual void setPosition ( const Point position)
overridevirtual

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

Usually we use Point(x,y) to compose Point 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( Point(size.width/2, size.height/2) )
Parameters
positionThe position (x,y) of the node in OpenGL coordinates

Reimplemented from Node.

Reimplemented in PhysicsSprite.

virtual void
setReorderChildDirtyRecursively
( void  )
protectedvirtual
var setReorderChildDirtyRecursively (   )
protectedvirtual
local
setReorderChildDirtyRecursively
(   )
protectedvirtual
virtual void setRotation ( float  rotation)
overridevirtual

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
rotationThe rotation of the node in degrees.

Reimplemented from Node.

Reimplemented in PhysicsSprite.

var setRotation ( var  rotation)
overridevirtual

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
rotationThe rotation of the node in degrees.

Reimplemented from Node.

Reimplemented in PhysicsSprite.

local setRotation ( local  rotation)
overridevirtual

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
rotationThe rotation of the node in degrees.

Reimplemented from Node.

Reimplemented in PhysicsSprite.

virtual void setRotationX ( float  rotationX)
overridevirtual

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
rotationXThe X rotation in degrees which performs a horizontal rotational skew.

Reimplemented from Node.

var setRotationX ( var  rotationX)
overridevirtual

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
rotationXThe X rotation in degrees which performs a horizontal rotational skew.

Reimplemented from Node.

local setRotationX ( local  rotationX)
overridevirtual

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
rotationXThe X rotation in degrees which performs a horizontal rotational skew.

Reimplemented from Node.

virtual void setRotationY ( float  rotationY)
overridevirtual

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
rotationYThe Y rotation in degrees.

Reimplemented from Node.

var setRotationY ( var  rotationY)
overridevirtual

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
rotationYThe Y rotation in degrees.

Reimplemented from Node.

local setRotationY ( local  rotationY)
overridevirtual

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
rotationYThe Y rotation in degrees.

Reimplemented from Node.

virtual void setScale ( float  scale)
overridevirtual

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 Node.

var setScale ( var  scale)
overridevirtual

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 Node.

local setScale ( local  scale)
overridevirtual

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 Node.

virtual void setScaleX ( float  scaleX)
overridevirtual

Changes the scale factor on X axis of this node.

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

Parameters
scaleXThe scale factor on X axis.

Reimplemented from Node.

var setScaleX ( var  scaleX)
overridevirtual

Changes the scale factor on X axis of this node.

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

Parameters
scaleXThe scale factor on X axis.

Reimplemented from Node.

local setScaleX ( local  scaleX)
overridevirtual

Changes the scale factor on X axis of this node.

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

Parameters
scaleXThe scale factor on X axis.

Reimplemented from Node.

virtual void setScaleY ( float  scaleY)
overridevirtual

Changes the scale factor on Y axis of this node.

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

Parameters
scaleYThe scale factor on Y axis.

Reimplemented from Node.

var setScaleY ( var  scaleY)
overridevirtual

Changes the scale factor on Y axis of this node.

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

Parameters
scaleYThe scale factor on Y axis.

Reimplemented from Node.

local setScaleY ( local  scaleY)
overridevirtual

Changes the scale factor on Y axis of this node.

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

Parameters
scaleYThe scale factor on Y axis.

Reimplemented from Node.

virtual void setSkewX ( float  fSkewX)
overridevirtual

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 Node.

var setSkewX ( var  fSkewX)
overridevirtual

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 Node.

local setSkewX ( local  fSkewX)
overridevirtual

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 Node.

virtual void setSkewY ( float  fSkewY)
overridevirtual

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 Node.

var setSkewY ( var  fSkewY)
overridevirtual

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 Node.

local setSkewY ( local  fSkewY)
overridevirtual

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 Node.

virtual void setTexture ( Texture2D texture)
overridevirtual

Sets a new texuture.

It will be retained.

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

Implements TextureProtocol.

var setTexture ( var  texture)
overridevirtual

Sets a new texuture.

It will be retained.

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

Implements TextureProtocol.

local setTexture ( local  texture)
overridevirtual

Sets a new texuture.

It will be retained.

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

Implements TextureProtocol.

void setTextureAtlas ( TextureAtlas pobTextureAtlas)
inline

Sets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode.

var setTextureAtlas ( var  pobTextureAtlas)
inline

Sets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode.

local setTextureAtlas ( local  pobTextureAtlas)
inline

Sets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode.

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

Updates the texture rect of the Sprite in points.

It will call setTextureRect(const Rect& rect, bool rotated, const Size& untrimmedSize) with rotated = false, and utrimmedSize = rect.size.

var setTextureRect ( var  rect)
virtual

Updates the texture rect of the Sprite in points.

It will call setTextureRect(const Rect& rect, bool rotated, const Size& untrimmedSize) with rotated = false, and utrimmedSize = rect.size.

local setTextureRect ( local  rect)
virtual

Updates the texture rect of the Sprite in points.

It will call setTextureRect(const Rect& rect, bool rotated, const Size& untrimmedSize) with rotated = false, and utrimmedSize = rect.size.

virtual void setTextureRect ( const Rect rect,
bool  rotated,
const Size untrimmedSize 
)
virtual

Sets the texture rect, rectRotated and untrimmed size of the Sprite 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 Sprite 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 Sprite in points.

It will update the texture coordinates and the vertex rectangle.

virtual void setVertexRect ( const Rect 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)
overridevirtual

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
vertexZOpenGL Z vertex of this node.

Reimplemented from Node.

var setVertexZ ( var  vertexZ)
overridevirtual

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
vertexZOpenGL Z vertex of this node.

Reimplemented from Node.

local setVertexZ ( local  vertexZ)
overridevirtual

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
vertexZOpenGL Z vertex of this node.

Reimplemented from Node.

virtual void setVisible ( bool  visible)
overridevirtual

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 Node.

var setVisible ( var  visible)
overridevirtual

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 Node.

local setVisible ( local  visible)
overridevirtual

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 Node.

virtual void sortAllChildren ( )
overridevirtual

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 Node.

var sortAllChildren ( )
overridevirtual

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 Node.

local sortAllChildren ( )
overridevirtual

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 Node.

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 Color3B color)
overridevirtual

recursive method that updates display color

Reimplemented from NodeRGBA.

var updateDisplayedColor ( var  color)
overridevirtual

recursive method that updates display color

Reimplemented from NodeRGBA.

local updateDisplayedColor ( local  color)
overridevirtual

recursive method that updates display color

Reimplemented from NodeRGBA.

virtual void updateDisplayedOpacity ( GLubyte  opacity)
overridevirtual

recursive method that updates the displayed opacity.

Reimplemented from NodeRGBA.

var updateDisplayedOpacity ( var  opacity)
overridevirtual

recursive method that updates the displayed opacity.

Reimplemented from NodeRGBA.

local updateDisplayedOpacity ( local  opacity)
overridevirtual

recursive method that updates the displayed opacity.

Reimplemented from NodeRGBA.

virtual void updateTransform ( void  )
virtual

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

Reimplemented from Node.

Reimplemented in Skin.

var updateTransform (   )
virtual

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

Reimplemented from Node.

Reimplemented in Skin.

local updateTransform (   )
virtual

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

Reimplemented from Node.

Reimplemented in Skin.

Variable Documentation

int _atlasIndex
protected

SpriteBatchNode texture atlas (weak reference)

var _atlasIndex
protected

SpriteBatchNode texture atlas (weak reference)

local _atlasIndex
protected

SpriteBatchNode texture atlas (weak reference)

SpriteBatchNode* _batchNode
protected

Absolute (real) Index on the SpriteSheet.

var _batchNode
protected

Absolute (real) Index on the SpriteSheet.

local _batchNode
protected

Absolute (real) Index on the SpriteSheet.

BlendFunc _blendFunc
protected
var _blendFunc
protected
local _blendFunc
protected
bool _dirty
protected

Used batch node (weak reference)

var _dirty
protected

Used batch node (weak reference)

local _dirty
protected

Used batch node (weak reference)

bool _flippedX
protected
var _flippedX
protected
local _flippedX
protected
bool _flippedY
protected

Whether the sprite is flipped horizaontally or not.

var _flippedY
protected

Whether the sprite is flipped horizaontally or not.

local _flippedY
protected

Whether the sprite is flipped horizaontally or not.

bool _hasChildren
protected

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

var _hasChildren
protected

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

local _hasChildren
protected

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

Point _offsetPosition
protected

Whether the texture is rotated.

var _offsetPosition
protected

Whether the texture is rotated.

local _offsetPosition
protected

Whether the texture is rotated.

bool _opacityModifyRGB
protected
var _opacityModifyRGB
protected
local _opacityModifyRGB
protected
V3F_C4B_T2F_Quad _quad
protected
var _quad
protected
local _quad
protected
Rect _rect
protected

Texture2D object that is used to render the sprite.

var _rect
protected

Texture2D object that is used to render the sprite.

local _rect
protected

Texture2D object that is used to render the sprite.

bool _rectRotated
protected

Retangle of Texture2D.

var _rectRotated
protected

Retangle of Texture2D.

local _rectRotated
protected

Retangle of Texture2D.

bool _recursiveDirty
protected

Whether the sprite needs to be updated.

var _recursiveDirty
protected

Whether the sprite needs to be updated.

local _recursiveDirty
protected

Whether the sprite needs to be updated.

bool _shouldBeHidden
protected

Whether the sprite contains children.

var _shouldBeHidden
protected

Whether the sprite contains children.

local _shouldBeHidden
protected

Whether the sprite contains children.

Texture2D* _texture
protected

It's required for TextureProtocol inheritance.

var _texture
protected

It's required for TextureProtocol inheritance.

local _texture
protected

It's required for TextureProtocol inheritance.

TextureAtlas* _textureAtlas
protected
AffineTransform _transformToBatch
protected

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

var _transformToBatch
protected

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

local _transformToBatch
protected

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

Point
_unflippedOffsetPositionFromCenter
protected
var
_unflippedOffsetPositionFromCenter
protected
local
_unflippedOffsetPositionFromCenter
protected