cocos2d-x  3.2
 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...
 
struct  AnimationFrame::DisplayedEventInfo
 
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

bool isFlipY ()
void setFlipY (bool flippedY)
var setFlipY ( var flippedY)
local setFlipY ( local flippedY)
virtual std::string getDescription () const override
 Gets the description string. More...
 
var getDescription ()
 Gets the description string. More...
 
local getDescription ()
 Gets the description string. More...
 
virtual ~Sprite (void)
var ~Sprite ()
local ~Sprite ()
virtual bool init (void)
var init ()
local init ()
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...
 
var initWithTexture ( var texture, var rect)
 Initializes a sprite with a texture and a rect. More...
 
local initWithTexture ( local texture, local 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 std::string &spriteFrameName)
 Initializes a sprite with an sprite frame name. More...
 
var initWithSpriteFrameName ( var spriteFrameName)
 Initializes a sprite with an sprite frame name. More...
 
local initWithSpriteFrameName ( local spriteFrameName)
 Initializes a sprite with an sprite frame name. More...
 
virtual bool initWithFile (const std::string &filename)
 Initializes a sprite with an image filename. More...
 
virtual bool initWithFile (const std::string &filename, const Rect &rect)
 Initializes a sprite with an image filename, and a rect. More...
 
var init ( var filename, var rect)
 Initializes a sprite with an image filename, and a rect. More...
 
local init ( local filename, local rect)
 Initializes a sprite with an image filename, and a rect. More...
 
void updateColor (void)
var updateColor ()
local updateColor ()
virtual void setTextureCoords (Rect rect)
local setTextureCoords ( local rect)
virtual void updateBlendFunc (void)
var updateBlendFunc ()
local updateBlendFunc ()
virtual void setReorderChildDirtyRecursively (void)
local setReorderChildDirtyRecursively ()
virtual void setDirtyRecursively (bool bValue)
var setDirtyRecursively ( var bValue)
local setDirtyRecursively ( local bValue)

Variables

CC_CONSTRUCTOR_ACCESS __pad0__: Sprite(void)
local __pad0__: Sprite(void)
TextureAtlas * _textureAtlas
ssize_t _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...
 
var _dirty
 Used batch node (weak reference) More...
 
local _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 _shouldBeHidden
 Whether all of the sprite's children needs to be updated. More...
 
var _shouldBeHidden
 Whether all of the sprite's children needs to be updated. More...
 
local _shouldBeHidden
 Whether all of the sprite's children needs to be updated. More...
 
Mat4 _transformToBatch
 should not be drawn because one of the ancestors is not visible More...
 
BlendFunc _blendFunc
var _blendFunc
local _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...
 
QuadCommand _quadCommand
 Texture2D object that is used to render the sprite. More...
 
var _quadCommand
 Texture2D object that is used to render the sprite. More...
 
local _quadCommand
 Texture2D object that is used to render the sprite. More...
 
Rect _rect
 quad command More...
 
var _rect
 quad command More...
 
local _rect
 quad command More...
 
bool _rectRotated
 Retangle of Texture2D. More...
 
var _rectRotated
 Retangle of Texture2D. More...
 
local _rectRotated
 Retangle of Texture2D. More...
 
Vec2 _offsetPosition
 Whether the texture is rotated. More...
 
var _offsetPosition
 Whether the texture is rotated. More...
 
local _offsetPosition
 Whether the texture is rotated. More...
 
Vec2 _unflippedOffsetPositionFromCenter
var _unflippedOffsetPositionFromCenter
local _unflippedOffsetPositionFromCenter
V3F_C4B_T2F_Quad _quad
local _quad
bool _opacityModifyRGB
var _opacityModifyRGB
local _opacityModifyRGB
bool _flippedX
var _flippedX
local _flippedX
bool _flippedY
 Whether the sprite is flipped horizontally or not. More...
 
var _flippedY
 Whether the sprite is flipped horizontally or not. More...
 
local _flippedY
 Whether the sprite is flipped horizontally or not. More...
 
bool _insideBounds
 Whether the sprite is flipped vertically or not. More...
 
var _insideBounds
 Whether the sprite is flipped vertically or not. More...
 
local _insideBounds
 Whether the sprite is flipped vertically or not. More...
 

Creators

Sprite invalid index on the SpriteBatchNode

static Sprite * create ()
 Creates an empty sprite without texture. More...
 
static Sprite * create (const std::string &filename)
 Creates a sprite with an image filename. More...
 
var create ( var 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 std::string &filename, const Rect &rect)
 Creates a sprite with an image filename and a rect. More...
 
var create ( var filename, var 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 a Texture2D object. More...
 
static Sprite * createWithTexture (Texture2D *texture, const Rect &rect, bool rotated=false)
 Creates a sprite with a texture and a rect. More...
 
var createWithTexture ( var texture, var rect, var false)
 Creates a sprite with a texture and a rect. More...
 
local createWithTexture ( local texture, local rect, local false)
 Creates a sprite with a texture and a rect. More...
 
static Sprite * createWithSpriteFrame (SpriteFrame *spriteFrame)
 Creates a sprite with an sprite frame. More...
 
var createWithSpriteFrame ( var spriteFrame)
 Creates a sprite with an sprite frame. More...
 
local createWithSpriteFrame ( local spriteFrame)
 Creates a sprite with an sprite frame. More...
 
static Sprite * createWithSpriteFrameName (const std::string &spriteFrameName)
 Creates a sprite with an sprite frame name. More...
 
var createWithSpriteFrameName ( var spriteFrameName)
 Creates a sprite with an sprite frame name. More...
 
local createWithSpriteFrameName ( local spriteFrameName)
 Creates a sprite with an sprite frame name. 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 / Frame methods

virtual void setTexture (const std::string &filename)
 Sets a new texture (from a filename) to the sprite. More...
 
virtual void setTexture (Texture2D *texture) override
 Sets a new texture to the sprite. More...
 
virtual Texture2D * getTexture () const override
 returns the Texture2D object used by the sprite More...
 
var getTexture ()
 returns the Texture2D object used by the sprite More...
 
local getTexture ()
 returns the Texture2D object used by the sprite More...
 
virtual void setTextureRect (const Rect &rect)
 Updates the texture rect of the Sprite in points. More...
 
local setTextureRect ( local 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...
 
virtual void setSpriteFrame (const std::string &spriteFrameName)
 Sets a new SpriteFrame to the Sprite. More...
 
var setSpriteFrame ( var spriteFrameName)
 Sets a new SpriteFrame to the Sprite. More...
 
local setSpriteFrame ( local spriteFrameName)
 Sets a new SpriteFrame to the Sprite. More...
 
virtual void setSpriteFrame (SpriteFrame *newFrame)
var setSpriteFrame ( var newFrame)
local setSpriteFrame ( local newFrame)
virtual void setDisplayFrame (SpriteFrame *newFrame)
virtual bool isFrameDisplayed (SpriteFrame *pFrame) const
 Returns whether or not a SpriteFrame is being displayed. More...
 
virtual SpriteFrame * getSpriteFrame () const
 Returns the current displayed frame. More...
 
local getSpriteFrame ()
 Returns the current displayed frame. More...
 
virtual SpriteFrame * getDisplayFrame () const
var getDisplayFrame ()
local getDisplayFrame ()
virtual SpriteFrame * displayFrame () const
var displayFrame ()
local displayFrame ()

Animation methods

virtual void setDisplayFrameWithAnimationName (const std::string &animationName, ssize_t 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...
 
virtual void setDirty (bool dirty)
 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...
 
ssize_t getAtlasIndex (void) const
 Returns the index used on the TextureAtlas. More...
 
var getAtlasIndex ()
 Returns the index used on the TextureAtlas. More...
 
local getAtlasIndex ()
 Returns the index used on the TextureAtlas. More...
 
void setAtlasIndex (ssize_t 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...
 
var setTextureAtlas ( var pobTextureAtlas)
 Sets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode. More...
 
local setTextureAtlas ( local pobTextureAtlas)
 Sets the weak reference of the TextureAtlas when the sprite is rendered using via SpriteBatchNode. More...
 
const Vec2getOffsetPosition (void) const
 Gets the offset position of the sprite. More...
 
local getOffsetPosition ()
 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...
 
bool isFlipX ()
void setFlipX (bool flippedX)
var setFlipX ( var 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

void setBlendFunc (const BlendFunc &blendFunc) override
var setBlendFunc ( var blendFunc)
local setBlendFunc ( local blendFunc)
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
 Sets the scale (x) of the node. More...
 
virtual void setScaleY (float scaleY) override
 Sets the scale (y) of the node. More...
 
var setScaleY ( var scaleY)
 Sets the scale (y) of the node. More...
 
local setScaleY ( local scaleY)
 Sets the scale (y) of the node. More...
 
virtual void setScale (float scaleX, float scaleY) override
 Sets the scale (x,y) of the node. More...
 
var setScale ( var scaleX, var scaleY)
 Sets the scale (x,y) of the node. More...
 
local setScale ( local scaleX, local scaleY)
 Sets the scale (x,y) of the node. More...
 
virtual void setPosition (const Vec2 &pos) override
 Sets the position (x,y) of the node in its parent's coordinate system. More...
 
virtual void setPosition (float x, float y) override
 Sets the position (x,y) of the node in its parent's coordinate system. More...
 
var setPosition ( var x, var y)
 Sets the position (x,y) of the node in its parent's coordinate system. More...
 
local setPosition ( local x, local y)
 Sets the position (x,y) of the node in its parent's coordinate system. More...
 
virtual void setRotation (float rotation) override
 Sets the rotation (angle) of the node in degrees. More...
 
var setRotation ( var rotation)
 Sets the rotation (angle) of the node in degrees. More...
 
local setRotation ( local rotation)
 Sets the rotation (angle) of the node in degrees. More...
 
virtual void setRotationSkewX (float rotationX) override
 Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew. More...
 
virtual void setRotationSkewY (float rotationY) override
 Sets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew. More...
 
var setRotationSkewY ( var rotationY)
 Sets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew. More...
 
local setRotationSkewY ( local rotationY)
 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...
 
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) override
 Changes the Y skew angle of the node in degrees. More...
 
var setSkewY ( var 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 (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...
 
virtual void reorderChild (Node *child, int zOrder) override
 Reorders a child according to a new z value. More...
 
var reorderChild ( var child, var zOrder)
 Reorders a child according to a new z value. More...
 
local reorderChild ( local child, local zOrder)
 Reorders a child according to a new z value. 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 addChild (Node *child, int zOrder, const std::string &name) override
 Adds a child to the container with z order and tag. More...
 
var addChild ( var child, var zOrder, var name)
 Adds a child to the container with z order and tag. More...
 
local addChild ( local child, local zOrder, local name)
 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...
 
var sortAllChildren ()
 Sorts the children array once before drawing, instead of every time when a child is added or reordered. More...
 
local sortAllChildren ()
 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
 Sets the scale (x,y,z) of the node. More...
 
local setScale ( local scale)
 Sets the scale (x,y,z) of the node. More...
 
virtual void setPositionZ (float positionZ) override
 Sets the 'z' coordinate in the position. More...
 
var setPositionZ ( var positionZ)
 Sets the 'z' coordinate in the position. More...
 
local setPositionZ ( local positionZ)
 Sets the 'z' coordinate in the position. More...
 
virtual void setAnchorPoint (const Vec2 &anchor) override
 Sets the anchor point in percent. More...
 
var setAnchorPoint ( var anchor)
 Sets the anchor point in percent. More...
 
local setAnchorPoint ( local anchor)
 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...
 
var setVisible ( var bVisible)
 Sets whether the node is visible. More...
 
local setVisible ( local bVisible)
 Sets whether the node is visible. More...
 
virtual void draw (Renderer *renderer, const Mat4 &transform, uint32_t flags) override
 Override this method to draw your own node. More...
 
virtual void setOpacityModifyRGB (bool modify) override
virtual bool isOpacityModifyRGB (void) const override
var isOpacityModifyRGB ()
local isOpacityModifyRGB ()

Detailed Description

Function Documentation

virtual ~Sprite ( void  )
virtual
var ~Sprite (   )
virtual
local ~Sprite (   )
virtual
virtual void addChild ( Node child,
int  localZOrder,
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 setLocalZOrder(int)
tagAn integer to identify the node easily. Please refer to setTag(int)

Please use addChild(Node* child, int localZOrder, const std::string &name) instead.

Reimplemented from Node.

var addChild ( var  child,
var  localZOrder,
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 setLocalZOrder(int)
tagAn integer to identify the node easily. Please refer to setTag(int)

Please use addChild(Node* child, int localZOrder, const std::string &name) instead.

Reimplemented from Node.

local addChild ( local  child,
local  localZOrder,
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 setLocalZOrder(int)
tagAn integer to identify the node easily. Please refer to setTag(int)

Please use addChild(Node* child, int localZOrder, const std::string &name) instead.

Reimplemented from Node.

virtual void addChild ( Node child,
int  localZOrder,
const std::string &  name 
)
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 setLocalZOrder(int)
nameA string to identify the node easily. Please refer to setName(int)

Reimplemented from Node.

var addChild ( var  child,
var  localZOrder,
var  name 
)
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 setLocalZOrder(int)
nameA string to identify the node easily. Please refer to setName(int)

Reimplemented from Node.

local addChild ( local  child,
local  localZOrder,
local  name 
)
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 setLocalZOrder(int)
nameA string to identify the node easily. Please refer to setName(int)

Reimplemented from Node.

static Sprite* create ( )
static

Creates an empty sprite without texture.

You can call setTexture method subsequently.

Returns
An autoreleased sprite object.
var create ( )
static

Creates an empty sprite without texture.

You can call setTexture method subsequently.

Returns
An autoreleased sprite object.
local create ( )
static

Creates an empty sprite without texture.

You can call setTexture method subsequently.

Returns
An autoreleased sprite object.
static Sprite* create ( const std::string &  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
filenameA path to image file, e.g., "scene1/monster.png"
Returns
An autoreleased sprite object.
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
filenameA path to image file, e.g., "scene1/monster.png"
Returns
An autoreleased sprite object.
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
filenameA path to image file, e.g., "scene1/monster.png"
Returns
An autoreleased sprite object.
static Sprite* create ( const std::string &  filename,
const Rect rect 
)
static

Creates a sprite with an image filename and a rect.

Parameters
filenameA path to image file, e.g., "scene1/monster.png"
rectA subrect of the image file
Returns
An autoreleased sprite object
var create ( var  filename,
var  rect 
)
static

Creates a sprite with an image filename and a rect.

Parameters
filenameA path to image file, e.g., "scene1/monster.png"
rectA subrect of the image file
Returns
An autoreleased sprite object
local create ( local  filename,
local  rect 
)
static

Creates a sprite with an image filename and a rect.

Parameters
filenameA path to image file, e.g., "scene1/monster.png"
rectA subrect of the image file
Returns
An autoreleased sprite object
static Sprite*
createWithSpriteFrame
( SpriteFrame spriteFrame)
static

Creates a sprite with an sprite frame.

Parameters
spriteFrameA sprite frame which involves a texture and a rect
Returns
An autoreleased sprite object
var createWithSpriteFrame ( var  spriteFrame)
static

Creates a sprite with an sprite frame.

Parameters
spriteFrameA sprite frame which involves a texture and a rect
Returns
An autoreleased sprite object
local createWithSpriteFrame ( local  spriteFrame)
static

Creates a sprite with an sprite frame.

Parameters
spriteFrameA sprite frame which involves a texture and a rect
Returns
An autoreleased sprite object
static Sprite*
createWithSpriteFrameName
( const std::string &  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
An autoreleased sprite object
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
An autoreleased sprite object
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
An autoreleased sprite object
static Sprite* createWithTexture ( Texture2D texture)
static

Creates a sprite with 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
An autoreleased sprite object
var createWithTexture ( var  texture)
static

Creates a sprite with 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
An autoreleased sprite object
local createWithTexture ( local  texture)
static

Creates a sprite with 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
An autoreleased sprite object
static Sprite* createWithTexture ( Texture2D texture,
const Rect rect,
bool  rotated = false 
)
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.
rotatedWhether or not the rect is rotated
Returns
An autoreleased sprite object
var createWithTexture ( var  texture,
var  rect,
var  rotated = false 
)
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.
rotatedWhether or not the rect is rotated
Returns
An autoreleased sprite object
local createWithTexture ( local  texture,
local  rect,
local  rotated = false 
)
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.
rotatedWhether or not the rect is rotated
Returns
An autoreleased sprite object
virtual SpriteFrame* displayFrame ( ) const
inlinevirtual
var displayFrame ( )
inlinevirtual
local displayFrame ( )
inlinevirtual
virtual void draw ( Renderer renderer,
const Mat4 transform,
uint32_t  flags 
)
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 PhysicsSprite.

var draw ( var  renderer,
var  transform,
var  flags 
)
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 PhysicsSprite.

local draw ( local  renderer,
local  transform,
local  flags 
)
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 PhysicsSprite.

ssize_t 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, nullptr 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, nullptr 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, nullptr 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 std::string getDescription ( ) const
overridevirtual

Gets the description string.

It makes debugging easier.

Returns
A string

Reimplemented from Node.

var getDescription ( )
overridevirtual

Gets the description string.

It makes debugging easier.

Returns
A string

Reimplemented from Node.

local getDescription ( )
overridevirtual

Gets the description string.

It makes debugging easier.

Returns
A string

Reimplemented from Node.

virtual SpriteFrame*
getDisplayFrame
( ) const
inlinevirtual
var getDisplayFrame ( )
inlinevirtual
local getDisplayFrame ( )
inlinevirtual
const Vec2& 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 SpriteFrame* getSpriteFrame ( ) const
virtual

Returns the current displayed frame.

var getSpriteFrame ( )
virtual

Returns the current displayed frame.

local getSpriteFrame ( )
virtual

Returns the current displayed frame.

virtual Texture2D* getTexture ( ) const
overridevirtual

returns the Texture2D object used by the sprite

Implements TextureProtocol.

var getTexture ( )
overridevirtual

returns the Texture2D object used by the sprite

Implements TextureProtocol.

local getTexture ( )
overridevirtual

returns the Texture2D object used by the sprite

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 should 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 should 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 should be renamed as setIgnoreAnchorPointForPosition(bool) or something with "set"

Reimplemented from Node.

virtual bool init ( void  )
virtual

Reimplemented from Node.

var init (   )
virtual

Reimplemented from Node.

local init (   )
virtual

Reimplemented from Node.

virtual bool initWithFile ( const std::string &  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 std::string &  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 std::string &  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 horizontally, 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 horizontally, 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 horizontally, 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, false 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, false 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, false otherwise.
bool isFlipX ( )
inline
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

Reimplemented from Node.

var isOpacityModifyRGB (   )
overridevirtual

Reimplemented from Node.

local isOpacityModifyRGB (   )
overridevirtual

Reimplemented from Node.

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  localZOrder 
)
overridevirtual

Reorders a child according to a new z value.

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

Reimplemented from Node.

var reorderChild ( var  child,
var  localZOrder 
)
overridevirtual

Reorders a child according to a new z value.

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

Reimplemented from Node.

local reorderChild ( local  child,
local  localZOrder 
)
overridevirtual

Reorders a child according to a new z value.

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

Reimplemented from Node.

virtual void setAnchorPoint ( const Vec2 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.

Note
If node has a physics body, the anchor must be in the middle, you cann't change this to other value.
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.

Note
If node has a physics body, the anchor must be in the middle, you cann't change this to other value.
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.

Note
If node has a physics body, the anchor must be in the middle, you cann't change this to other value.
Parameters
anchorPointThe anchor point of node.

Reimplemented from Node.

void setAtlasIndex ( ssize_t  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 setDirty ( bool  dirty)
inlinevirtual

Makes the Sprite to be updated in the Atlas.

var setDirty ( var  dirty)
inlinevirtual

Makes the Sprite to be updated in the Atlas.

local setDirty ( local  dirty)
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 newFrame)
inlinevirtual
var setDisplayFrame ( var  newFrame)
inlinevirtual
local setDisplayFrame ( local  newFrame)
inlinevirtual
virtual void
setDisplayFrameWithAnimationName
( const std::string &  animationName,
ssize_t  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
flippedXtrue if the sprite should be flipped horizontally, false otherwise.
var setFlippedX ( var  flippedX)

Sets whether the sprite should be flipped horizontally or not.

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

Sets whether the sprite should be flipped horizontally or not.

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

Sets whether the sprite should be flipped vertically or not.

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

Sets whether the sprite should be flipped vertically or not.

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

Sets whether the sprite should be flipped vertically or not.

Parameters
flippedYtrue if the sprite should be flipped vertically, false otherwise.
void setFlipX ( bool  flippedX)
inline
var setFlipX ( var  flippedX)
inline
local setFlipX ( local  flippedX)
inline
void setFlipY ( bool  flippedY)
inline
var setFlipY ( var  flippedY)
inline
local setFlipY ( local  flippedY)
inline
virtual void setOpacityModifyRGB ( bool  modify)
overridevirtual

Reimplemented from Node.

var setOpacityModifyRGB ( var  modify)
overridevirtual

Reimplemented from Node.

local setOpacityModifyRGB ( local  modify)
overridevirtual

Reimplemented from Node.

virtual void setPosition ( const Vec2 position)
overridevirtual

Sets the position (x,y) of the node in its parent's coordinate system.

Usually we use Vec2(x,y) to compose Vec2 object. This code snippet sets the node in the center of screen.

node->setPosition( Vec2(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 setPosition ( float  x,
float  y 
)
overridevirtual

Sets the position (x,y) of the node in its parent's coordinate system.

Passing two numbers (x,y) is much efficient than passing Vec2 object. This method is bound to Lua and JavaScript. Passing a number is 10 times faster than passing a object from Lua to c++

// sample code in Lua
local pos = node::getPosition() -- returns Vec2 object from C++
node:setPosition(x, y) -- pass x, y coordinate to C++
Parameters
xX coordinate for position
yY coordinate for position

Reimplemented from Node.

var setPosition ( var  x,
var  y 
)
overridevirtual

Sets the position (x,y) of the node in its parent's coordinate system.

Passing two numbers (x,y) is much efficient than passing Vec2 object. This method is bound to Lua and JavaScript. Passing a number is 10 times faster than passing a object from Lua to c++

// sample code in Lua
local pos = node::getPosition() -- returns Vec2 object from C++
node:setPosition(x, y) -- pass x, y coordinate to C++
Parameters
xX coordinate for position
yY coordinate for position

Reimplemented from Node.

local setPosition ( local  x,
local  y 
)
overridevirtual

Sets the position (x,y) of the node in its parent's coordinate system.

Passing two numbers (x,y) is much efficient than passing Vec2 object. This method is bound to Lua and JavaScript. Passing a number is 10 times faster than passing a object from Lua to c++

// sample code in Lua
local pos = node::getPosition() -- returns Vec2 object from C++
node:setPosition(x, y) -- pass x, y coordinate to C++
Parameters
xX coordinate for position
yY coordinate for position

Reimplemented from Node.

virtual void setPositionZ ( float  positionZ)
overridevirtual

Sets the 'z' coordinate in the position.

It is the OpenGL Z vertex value.

The OpenGL depth buffer and depth testing are disabled by default. You need to turn them on in order to use this property correctly.

setPositionZ() also sets the setGlobalZValue() with the positionZ as value.

See also
setGlobalZValue()
Parameters
vertexZOpenGL Z vertex of this node.

Reimplemented from Node.

var setPositionZ ( var  positionZ)
overridevirtual

Sets the 'z' coordinate in the position.

It is the OpenGL Z vertex value.

The OpenGL depth buffer and depth testing are disabled by default. You need to turn them on in order to use this property correctly.

setPositionZ() also sets the setGlobalZValue() with the positionZ as value.

See also
setGlobalZValue()
Parameters
vertexZOpenGL Z vertex of this node.

Reimplemented from Node.

local setPositionZ ( local  positionZ)
overridevirtual

Sets the 'z' coordinate in the position.

It is the OpenGL Z vertex value.

The OpenGL depth buffer and depth testing are disabled by default. You need to turn them on in order to use this property correctly.

setPositionZ() also sets the setGlobalZValue() with the positionZ as value.

See also
setGlobalZValue()
Parameters
vertexZOpenGL Z vertex of this node.

Reimplemented from Node.

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 setRotationSkewX ( float  rotationX)
overridevirtual

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

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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.
Warning
The physics body doesn't support this.

Reimplemented from Node.

var setRotationSkewX ( var  rotationX)
overridevirtual

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

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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.
Warning
The physics body doesn't support this.

Reimplemented from Node.

local setRotationSkewX ( local  rotationX)
overridevirtual

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

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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.
Warning
The physics body doesn't support this.

Reimplemented from Node.

virtual void setRotationSkewY ( float  rotationY)
overridevirtual

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

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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

Parameters
rotationYThe Y rotation in degrees.
Warning
The physics body doesn't support this.

Reimplemented from Node.

var setRotationSkewY ( var  rotationY)
overridevirtual

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

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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

Parameters
rotationYThe Y rotation in degrees.
Warning
The physics body doesn't support this.

Reimplemented from Node.

local setRotationSkewY ( local  rotationY)
overridevirtual

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

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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

Parameters
rotationYThe Y rotation in degrees.
Warning
The physics body doesn't support this.

Reimplemented from Node.

virtual void setScale ( float  scaleX,
float  scaleY 
)
overridevirtual

Sets the scale (x,y) of the node.

It is a scaling factor that multiplies the width and height of the node and its children.

Parameters
scaleXThe scale factor on X axis.
scaleYThe scale factor on Y axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

var setScale ( var  scaleX,
var  scaleY 
)
overridevirtual

Sets the scale (x,y) of the node.

It is a scaling factor that multiplies the width and height of the node and its children.

Parameters
scaleXThe scale factor on X axis.
scaleYThe scale factor on Y axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

local setScale ( local  scaleX,
local  scaleY 
)
overridevirtual

Sets the scale (x,y) of the node.

It is a scaling factor that multiplies the width and height of the node and its children.

Parameters
scaleXThe scale factor on X axis.
scaleYThe scale factor on Y axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

virtual void setScale ( float  scale)
overridevirtual

Sets the scale (x,y,z) of the node.

It is a scaling factor that multiplies the width, height and depth of the node and its children.

Parameters
scaleThe scale factor for both X and Y axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

var setScale ( var  scale)
overridevirtual

Sets the scale (x,y,z) of the node.

It is a scaling factor that multiplies the width, height and depth of the node and its children.

Parameters
scaleThe scale factor for both X and Y axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

local setScale ( local  scale)
overridevirtual

Sets the scale (x,y,z) of the node.

It is a scaling factor that multiplies the width, height and depth of the node and its children.

Parameters
scaleThe scale factor for both X and Y axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

virtual void setScaleX ( float  scaleX)
overridevirtual

Sets the scale (x) of the node.

It is a scaling factor that multiplies the width of the node and its children.

Parameters
scaleXThe scale factor on X axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

var setScaleX ( var  scaleX)
overridevirtual

Sets the scale (x) of the node.

It is a scaling factor that multiplies the width of the node and its children.

Parameters
scaleXThe scale factor on X axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

local setScaleX ( local  scaleX)
overridevirtual

Sets the scale (x) of the node.

It is a scaling factor that multiplies the width of the node and its children.

Parameters
scaleXThe scale factor on X axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

virtual void setScaleY ( float  scaleY)
overridevirtual

Sets the scale (y) of the node.

It is a scaling factor that multiplies the height of the node and its children.

Parameters
scaleYThe scale factor on Y axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

var setScaleY ( var  scaleY)
overridevirtual

Sets the scale (y) of the node.

It is a scaling factor that multiplies the height of the node and its children.

Parameters
scaleYThe scale factor on Y axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

local setScaleY ( local  scaleY)
overridevirtual

Sets the scale (y) of the node.

It is a scaling factor that multiplies the height of the node and its children.

Parameters
scaleYThe scale factor on Y axis.
Warning
The physics body doesn't support this.

Reimplemented from Node.

virtual void setSkewX ( float  skewX)
overridevirtual

Changes the X skew angle of the node in degrees.

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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

Parameters
skewXThe X skew angle of the node in degrees.
Warning
The physics body doesn't support this.

Reimplemented from Node.

var setSkewX ( var  skewX)
overridevirtual

Changes the X skew angle of the node in degrees.

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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

Parameters
skewXThe X skew angle of the node in degrees.
Warning
The physics body doesn't support this.

Reimplemented from Node.

local setSkewX ( local  skewX)
overridevirtual

Changes the X skew angle of the node in degrees.

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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

Parameters
skewXThe X skew angle of the node in degrees.
Warning
The physics body doesn't support this.

Reimplemented from Node.

virtual void setSkewY ( float  skewY)
overridevirtual

Changes the Y skew angle of the node in degrees.

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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

Parameters
skewYThe Y skew angle of the node in degrees.
Warning
The physics body doesn't support this.

Reimplemented from Node.

var setSkewY ( var  skewY)
overridevirtual

Changes the Y skew angle of the node in degrees.

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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

Parameters
skewYThe Y skew angle of the node in degrees.
Warning
The physics body doesn't support this.

Reimplemented from Node.

local setSkewY ( local  skewY)
overridevirtual

Changes the Y skew angle of the node in degrees.

The difference between setRotationalSkew() and setSkew() is that the first one simulate Flash's skew functionality while the second one uses the real skew function.

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

Parameters
skewYThe Y skew angle of the node in degrees.
Warning
The physics body doesn't support this.

Reimplemented from Node.

virtual void setSpriteFrame ( const std::string &  spriteFrameName)
virtual

Sets a new SpriteFrame to the Sprite.

var setSpriteFrame ( var  spriteFrameName)
virtual

Sets a new SpriteFrame to the Sprite.

local setSpriteFrame ( local  spriteFrameName)
virtual

Sets a new SpriteFrame to the Sprite.

virtual void setSpriteFrame ( SpriteFrame newFrame)
virtual
var setSpriteFrame ( var  newFrame)
virtual
local setSpriteFrame ( local  newFrame)
virtual
virtual void setTexture ( const std::string &  filename)
virtual

Sets a new texture (from a filename) to the sprite.

It will call setTextureRect() with the texture's content size. TODO: The whole Sprite API needs to be reviewed.

var setTexture ( var  filename)
virtual

Sets a new texture (from a filename) to the sprite.

It will call setTextureRect() with the texture's content size. TODO: The whole Sprite API needs to be reviewed.

local setTexture ( local  filename)
virtual

Sets a new texture (from a filename) to the sprite.

It will call setTextureRect() with the texture's content size. TODO: The whole Sprite API needs to be reviewed.

virtual void setTexture ( Texture2D texture)
overridevirtual

Sets a new texture to the sprite.

The Texture's rect is not changed.

Implements TextureProtocol.

var setTexture ( var  texture)
overridevirtual

Sets a new texture to the sprite.

The Texture's rect is not changed.

Implements TextureProtocol.

local setTexture ( local  texture)
overridevirtual

Sets a new texture to the sprite.

The Texture's rect is not changed.

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 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  )
protectedvirtual

Reimplemented from Node.

var updateColor (   )
protectedvirtual

Reimplemented from Node.

local updateColor (   )
protectedvirtual

Reimplemented from Node.

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

var __pad0__
local __pad0__
ssize_t _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 horizontally or not.

var _flippedY
protected

Whether the sprite is flipped horizontally or not.

local _flippedY
protected

Whether the sprite is flipped horizontally or not.

bool _insideBounds
protected

Whether the sprite is flipped vertically or not.

var _insideBounds
protected

Whether the sprite is flipped vertically or not.

local _insideBounds
protected

Whether the sprite is flipped vertically or not.

Vec2 _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
QuadCommand _quadCommand
protected

Texture2D object that is used to render the sprite.

var _quadCommand
protected

Texture2D object that is used to render the sprite.

local _quadCommand
protected

Texture2D object that is used to render the sprite.

Rect _rect
protected

quad command

var _rect
protected

quad command

local _rect
protected

quad command

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 all of the sprite's children needs to be updated.

var _shouldBeHidden
protected

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

local _shouldBeHidden
protected

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

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
Mat4 _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

Vec2
_unflippedOffsetPositionFromCenter
protected
var
_unflippedOffsetPositionFromCenter
protected
local
_unflippedOffsetPositionFromCenter
protected