Cocos2d-x  v3.11
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Scale9Sprite Class Reference

A 9-slice sprite for cocos2d-x. More...

Inherits Node, and BlendProtocol.

Public Types

enum  State
 Builtin shader state. More...
 

Public Member Functions

 Scale9Sprite ()
 Default constructor.
 
 ctor ()
 Default constructor.
 
 new ()
 Default constructor.
 
virtual ~Scale9Sprite ()
 Default destructor.
 
virtual bool initWithFile (const std::string &file, const Rect &rect, const Rect &capInsets)
 Initializes a 9-slice sprite with a texture file, a delimitation zone and with the specified cap insets. More...
 
virtual bool initWithFile (const std::string &file, const Rect &rect)
 Initializes a 9-slice sprite with a texture file, a delimitation zone. More...
 
var initWithFile ( var file, var rect)
 Initializes a 9-slice sprite with a texture file, a delimitation zone. More...
 
local initWithFile ( local file, local rect)
 Initializes a 9-slice sprite with a texture file, a delimitation zone. More...
 
virtual bool initWithFile (const Rect &capInsets, const std::string &file)
 Initializes a 9-slice sprite with a texture file and with the specified cap insets. More...
 
var initWithFile ( var capInsets, var file)
 Initializes a 9-slice sprite with a texture file and with the specified cap insets. More...
 
local initWithFile ( local capInsets, local file)
 Initializes a 9-slice sprite with a texture file and with the specified cap insets. More...
 
virtual bool initWithFile (const std::string &file)
 Initializes a 9-slice sprite with a texture file. More...
 
virtual bool initWithSpriteFrame (SpriteFrame *spriteFrame, const Rect &capInsets)
 Initializes a 9-slice sprite with an sprite frame and with the specified cap insets. More...
 
local initWithSpriteFrame ( local spriteFrame, local capInsets)
 Initializes a 9-slice sprite with an sprite frame and with the specified cap insets. More...
 
virtual bool initWithSpriteFrame (SpriteFrame *spriteFrame)
 Initializes a 9-slice sprite with an sprite frame. More...
 
var initWithSpriteFrame ( var spriteFrame)
 Initializes a 9-slice sprite with an sprite frame. More...
 
local initWithSpriteFrame ( local spriteFrame)
 Initializes a 9-slice sprite with an sprite frame. More...
 
virtual bool initWithSpriteFrameName (const std::string &spriteFrameName, const Rect &capInsets)
 Initializes a 9-slice sprite with an sprite frame name and with the specified cap insets. More...
 
virtual bool initWithSpriteFrameName (const std::string &spriteFrameName)
 Initializes a 9-slice sprite with an sprite frame name. More...
 
local initWithSpriteFrameName ( local spriteFrameName)
 Initializes a 9-slice sprite with an sprite frame name. More...
 
virtual bool init (Sprite *sprite, const Rect &rect, bool rotated, const Rect &capInsets)
 Initializes a 9-slice sprite with an sprite instance. More...
 
virtual bool init (Sprite *sprite, const Rect &rect, const Rect &capInsets)
 Initializes a 9-slice sprite with an sprite instance. More...
 
local init ( local sprite, local rect, local capInsets)
 Initializes a 9-slice sprite with an sprite instance. More...
 
virtual bool init (Sprite *sprite, const Rect &rect, bool rotated, const Vec2 &offset, const Size &originalSize, const Rect &capInsets)
 Initializes a 9-slice sprite with an sprite instance and several parameters Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. More...
 
local init ( local sprite, local rect, local rotated, local offset, local originalSize, local capInsets)
 Initializes a 9-slice sprite with an sprite instance and several parameters Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. More...
 
 CC_DEPRECATED (v3) virtual bool initWithBatchNode(SpriteBatchNode *batchnode
 Initializes a 9-slice sprite with a sprite batchnode. More...
 
 CC_DEPRECATED (v3) virtual bool initWithBatchNode(SpriteBatchNode *batchnode
 Initializes a 9-slice sprite with a sprite batch node. More...
 
virtual void setBlendFunc (const BlendFunc &blendFunc) override
 Sets the source blending function. More...
 
virtual const BlendFuncgetBlendFunc () const override
 Returns the blending function that is currently being used. More...
 
Scale9SpriteresizableSpriteWithCapInsets (const Rect &capInsets) const
 Creates and returns a new sprite object with the specified cap insets. More...
 
local resizableSpriteWithCapInsets ( local capInsets)
 Creates and returns a new sprite object with the specified cap insets. More...
 
virtual bool updateWithSprite (Sprite *sprite, const Rect &rect, bool rotated, const Rect &capInsets)
 Update Scale9Sprite with a specified sprite. More...
 
local updateWithSprite ( local sprite, local rect, local rotated, local capInsets)
 Update Scale9Sprite with a specified sprite. More...
 
virtual bool updateWithSprite (Sprite *sprite, const Rect &rect, bool rotated, const Vec2 &offset, const Size &originalSize, const Rect &capInsets)
 Update Scale9Sprite with a specified sprite. More...
 
local updateWithSprite ( local sprite, local rect, local rotated, local offset, local originalSize, local capInsets)
 Update Scale9Sprite with a specified sprite. More...
 
 CC_DEPRECATED (v3) bool updateWithBatchNode(SpriteBatchNode *batchnode
 Update Scale9Sprite with a specified sprite. More...
 
 CC_DEPRECATED ( var v3)
 Update Scale9Sprite with a specified sprite. More...
 
 CC_DEPRECATED ( local v3)
 Update Scale9Sprite with a specified sprite. More...
 
virtual void setSpriteFrame (SpriteFrame *spriteFrame, const Rect &capInsets=Rect::ZERO)
 Change inner sprite's sprite frame. More...
 
local setSpriteFrame ( local spriteFrame, local ZERO)
 Change inner sprite's sprite frame. More...
 
virtual void setContentSize (const Size &size) override
 Sets the untransformed size of the node. More...
 
var setContentSize ( var size)
 Sets the untransformed size of the node. More...
 
local setContentSize ( local size)
 Sets the untransformed size of the node. More...
 
virtual void setAnchorPoint (const Vec2 &anchorPoint) override
 Sets the anchor point in percent. More...
 
var setAnchorPoint ( var anchorPoint)
 Sets the anchor point in percent. More...
 
local setAnchorPoint ( local anchorPoint)
 Sets the anchor point in percent. More...
 
void setState (State state)
 Change the state of 9-slice sprite.
 
local setState ( local state)
 Change the state of 9-slice sprite.
 
State getState () const
 Query the current bright state.
 
local getState ()
 Query the current bright state.
 
void setPreferredSize (const Size &size)
 Change the prefered size of Scale9Sprite. More...
 
var setPreferredSize ( var size)
 Change the prefered size of Scale9Sprite. More...
 
local setPreferredSize ( local size)
 Change the prefered size of Scale9Sprite. More...
 
Size getPreferredSize () const
 Query the Scale9Sprite's prefered size. More...
 
local getPreferredSize ()
 Query the Scale9Sprite's prefered size. More...
 
void setCapInsets (const Rect &rect)
 Change the cap inset size.
 
local setCapInsets ( local rect)
 Change the cap inset size.
 
Rect getCapInsets () const
 Query the Scale9Sprite's prefered size. More...
 
var getCapInsets ()
 Query the Scale9Sprite's prefered size. More...
 
local getCapInsets ()
 Query the Scale9Sprite's prefered size. More...
 
void setInsetLeft (float leftInset)
 Change the left sprite's cap inset. More...
 
var setInsetLeft ( var leftInset)
 Change the left sprite's cap inset. More...
 
local setInsetLeft ( local leftInset)
 Change the left sprite's cap inset. More...
 
float getInsetLeft () const
 Query the left sprite's cap inset. More...
 
local getInsetLeft ()
 Query the left sprite's cap inset. More...
 
void setInsetTop (float topInset)
 Change the top sprite's cap inset. More...
 
var setInsetTop ( var topInset)
 Change the top sprite's cap inset. More...
 
local setInsetTop ( local topInset)
 Change the top sprite's cap inset. More...
 
float getInsetTop () const
 Query the top sprite's cap inset. More...
 
local getInsetTop ()
 Query the top sprite's cap inset. More...
 
void setInsetRight (float rightInset)
 Change the right sprite's cap inset. More...
 
var setInsetRight ( var rightInset)
 Change the right sprite's cap inset. More...
 
local setInsetRight ( local rightInset)
 Change the right sprite's cap inset. More...
 
float getInsetRight () const
 Query the right sprite's cap inset. More...
 
local getInsetRight ()
 Query the right sprite's cap inset. More...
 
void setInsetBottom (float bottomInset)
 Change the bottom sprite's cap inset. More...
 
var setInsetBottom ( var bottomInset)
 Change the bottom sprite's cap inset. More...
 
local setInsetBottom ( local bottomInset)
 Change the bottom sprite's cap inset. More...
 
float getInsetBottom () const
 Query the bottom sprite's cap inset. More...
 
local getInsetBottom ()
 Query the bottom sprite's cap inset. More...
 
void setScale9Enabled (bool enabled)
 Toggle 9-slice feature. More...
 
local setScale9Enabled ( local enabled)
 Toggle 9-slice feature. More...
 
bool isScale9Enabled () const
 Query whether the Scale9Sprite is enable 9-slice or not. More...
 
local isScale9Enabled ()
 Query whether the Scale9Sprite is enable 9-slice or not. More...
 
virtual void draw (Renderer *renderer, const Mat4 &transform, uint32_t flags) override
 Override this method to draw your own node. More...
 
local draw ( local renderer, local transform, local flags)
 Override this method to draw your own node. More...
 
virtual void visit (Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override
 Visits this node's children and send their render command recursively. More...
 
var visit ( var renderer, var parentTransform, var parentFlags)
 Visits this node's children and send their render command recursively. More...
 
local visit ( local renderer, local parentTransform, local parentFlags)
 Visits this node's children and send their render command recursively. More...
 
virtual void updateDisplayedOpacity (GLubyte parentOpacity) override
 Update the displayed opacity of node with it's parent opacity;. More...
 
var updateDisplayedOpacity ( var parentOpacity)
 Update the displayed opacity of node with it's parent opacity;. More...
 
local updateDisplayedOpacity ( local parentOpacity)
 Update the displayed opacity of node with it's parent opacity;. More...
 
virtual void updateDisplayedColor (const Color3B &parentColor) override
 Update node's displayed color with its parent color. More...
 
local updateDisplayedColor ( local parentColor)
 Update node's displayed color with its parent color. More...
 
virtual void setGLProgram (GLProgram *glprogram) override
 Sets the shader program for this node. More...
 
var setGLProgram ( var glprogram)
 Sets the shader program for this node. More...
 
local setGLProgram ( local glprogram)
 Sets the shader program for this node. More...
 
virtual void setGLProgramState (GLProgramState *glProgramState) override
 Set the GLProgramState for this node. More...
 
local setGLProgramState ( local glProgramState)
 Set the GLProgramState for this node. More...
 
SpritegetSprite () const
 Get the original no 9-sliced sprite A sprite instance.
 
local getSprite ()
 Get the original no 9-sliced sprite A sprite instance.
 
virtual void setFlippedX (bool flippedX)
 Sets whether the widget should be flipped horizontally or not. More...
 
local setFlippedX ( local flippedX)
 Sets whether the widget should be flipped horizontally or not. More...
 
virtual bool isFlippedX () const
 Returns the flag which indicates whether the widget is flipped horizontally or not. More...
 
virtual void setFlippedY (bool flippedY)
 Sets whether the widget should be flipped vertically or not. More...
 
var setFlippedY ( var flippedY)
 Sets whether the widget should be flipped vertically or not. More...
 
local setFlippedY ( local flippedY)
 Sets whether the widget should be flipped vertically or not. More...
 
virtual bool isFlippedY () const
 Return the flag which indicates whether the widget is flipped vertically or not. More...
 
var isFlippedY ()
 Return the flag which indicates whether the widget is flipped vertically or not. More...
 
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...
 
local setScaleY ( local scaleY)
 Sets the scale (y) of the node. 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 setScale (float scaleX, float scaleY) override
 Sets the scale (x,y) of the node. More...
 
virtual float getScaleX () const override
 Returns the scale factor on X axis of this node The scale factor on X axis.
 
var getScaleX ()
 Returns the scale factor on X axis of this node The scale factor on X axis.
 
local getScaleX ()
 Returns the scale factor on X axis of this node The scale factor on X axis.
 
virtual float getScaleY () const override
 Returns the scale factor on Y axis of this node The scale factor on Y axis.
 
local getScaleY ()
 Returns the scale factor on Y axis of this node The scale factor on Y axis.
 
virtual float getScale () const override
 Gets the scale factor of the node, when X and Y have the same scale factor. More...
 
var getScale ()
 Gets the scale factor of the node, when X and Y have the same scale factor. More...
 
local getScale ()
 Gets the scale factor of the node, when X and Y have the same scale factor. More...
 
virtual void setCameraMask (unsigned short mask, bool applyChildren=true) override
 Modify the camera mask for current node. More...
 
virtual void setGlobalZOrder (float globalZOrder) override
 Defines the oder in which the nodes are renderer. More...
 
var setGlobalZOrder ( var globalZOrder)
 Defines the oder in which the nodes are renderer. More...
 
local setGlobalZOrder ( local globalZOrder)
 Defines the oder in which the nodes are renderer. More...
 
void setRenderingType (RenderingType type)
 Set the slice sprite rendering type. More...
 
RenderingType getRenderingType () const
 Return the slice sprite rendering type.
 
var getRenderingType ()
 Return the slice sprite rendering type.
 
local getRenderingType ()
 Return the slice sprite rendering type.
 
void resetRender ()
 Reset scale9 render to null.
 
local resetRender ()
 Reset scale9 render to null.
 
- Public Member Functions inherited from Node
virtual bool isRunning () const
 Returns whether or not the node is "running". More...
 
var isRunning ()
 Returns whether or not the node is "running". More...
 
local isRunning ()
 Returns whether or not the node is "running". More...
 
void scheduleUpdateWithPriorityLua (int handler, int priority)
 Schedules for lua script. More...
 
local scheduleUpdateWithPriorityLua ( local handler, local priority)
 Schedules for lua script. More...
 
virtual void cleanup ()
 Stops and removes all running actions and schedulers.
 
var cleanup ()
 Stops and removes all running actions and schedulers.
 
local cleanup ()
 Stops and removes all running actions and schedulers.
 
virtual ScenegetScene () const
 Returns the Scene that contains the Node. More...
 
virtual Rect getBoundingBox () const
 Returns an AABB (axis-aligned bounding-box) in its parent's coordinate system. More...
 
virtual Rect boundingBox () const
local boundingBox ()
virtual void setEventDispatcher (EventDispatcher *dispatcher)
 Set event dispatcher for node. More...
 
virtual EventDispatchergetEventDispatcher () const
 Get the event dispatcher. More...
 
local getEventDispatcher ()
 Get the event dispatcher. More...
 
void setPhysicsBody (PhysicsBody *body)
 Set the PhysicsBody that let the sprite effect with physics. More...
 
PhysicsBodygetPhysicsBody () const
 Get the PhysicsBody the sprite have. More...
 
var getPhysicsBody ()
 Get the PhysicsBody the sprite have. More...
 
local getPhysicsBody ()
 Get the PhysicsBody the sprite have. More...
 
void removeFromPhysicsWorld ()
 Remove this node from physics world. More...
 
var removeFromPhysicsWorld ()
 Remove this node from physics world. More...
 
local removeFromPhysicsWorld ()
 Remove this node from physics world. More...
 
void updateTransformFromPhysics (const Mat4 &parentTransform, uint32_t parentFlags)
 Update the transform matrix from physics.
 
var updateTransformFromPhysics ( var parentTransform, var parentFlags)
 Update the transform matrix from physics.
 
local updateTransformFromPhysics ( local parentTransform, local parentFlags)
 Update the transform matrix from physics.
 
virtual void updatePhysicsBodyTransform (const Mat4 &parentTransform, uint32_t parentFlags, float parentScaleX, float parentScaleY)
 Update physics body transform matrix.
 
virtual GLubyte getOpacity () const
 Return the node's opacity. More...
 
virtual GLubyte getDisplayedOpacity () const
 Return the node's display opacity. More...
 
local getDisplayedOpacity ()
 Return the node's display opacity. More...
 
virtual void setOpacity (GLubyte opacity)
 Change node opacity. More...
 
virtual bool isCascadeOpacityEnabled () const
 Whether cascadeOpacity is enabled or not. More...
 
virtual void setCascadeOpacityEnabled (bool cascadeOpacityEnabled)
 Change node's cascadeOpacity property. More...
 
local setCascadeOpacityEnabled ( local cascadeOpacityEnabled)
 Change node's cascadeOpacity property. More...
 
virtual const Color3BgetColor () const
 Query node's color value. More...
 
local getColor ()
 Query node's color value. More...
 
virtual const Color3BgetDisplayedColor () const
 Query node's displayed color. More...
 
local getDisplayedColor ()
 Query node's displayed color. More...
 
virtual void setColor (const Color3B &color)
 Change the color of node. More...
 
local setColor ( local color)
 Change the color of node. More...
 
virtual bool isCascadeColorEnabled () const
 Query whether cascadeColor is enabled or not. More...
 
var isCascadeColorEnabled ()
 Query whether cascadeColor is enabled or not. More...
 
local isCascadeColorEnabled ()
 Query whether cascadeColor is enabled or not. More...
 
virtual void setCascadeColorEnabled (bool cascadeColorEnabled)
 If you want node's color affect the children node's color, then set it to true. More...
 
virtual void setOpacityModifyRGB (bool value)
 If you want the opacity affect the color property, then set to true. More...
 
virtual bool isOpacityModifyRGB () const
 If node opacity will modify the RGB color value, then you should override this method and return true. More...
 
void setOnEnterCallback (const std::function< void()> &callback)
 Set the callback of event onEnter. More...
 
var setOnEnterCallback ( var callback)
 Set the callback of event onEnter. More...
 
local setOnEnterCallback ( local callback)
 Set the callback of event onEnter. More...
 
const std::function< void()> & getOnEnterCallback () const
 Get the callback of event onEnter. More...
 
local getOnEnterCallback ()
 Get the callback of event onEnter. More...
 
void setOnExitCallback (const std::function< void()> &callback)
 Set the callback of event onExit. More...
 
const std::function< void()> & getOnExitCallback () const
 Get the callback of event onExit. More...
 
local getOnExitCallback ()
 Get the callback of event onExit. More...
 
void setonEnterTransitionDidFinishCallback (const std::function< void()> &callback)
 Set the callback of event EnterTransitionDidFinish. More...
 
var setonEnterTransitionDidFinishCallback ( var callback)
 Set the callback of event EnterTransitionDidFinish. More...
 
local setonEnterTransitionDidFinishCallback ( local callback)
 Set the callback of event EnterTransitionDidFinish. More...
 
const std::function< void()> & getonEnterTransitionDidFinishCallback () const
 Get the callback of event EnterTransitionDidFinish. More...
 
local getonEnterTransitionDidFinishCallback ()
 Get the callback of event EnterTransitionDidFinish. More...
 
void setonExitTransitionDidStartCallback (const std::function< void()> &callback)
 Set the callback of event ExitTransitionDidStart. More...
 
var setonExitTransitionDidStartCallback ( var callback)
 Set the callback of event ExitTransitionDidStart. More...
 
local setonExitTransitionDidStartCallback ( local callback)
 Set the callback of event ExitTransitionDidStart. More...
 
const std::function< void()> & getonExitTransitionDidStartCallback () const
 Get the callback of event ExitTransitionDidStart. More...
 
unsigned short getCameraMask () const
 get & set camera mask, the node is visible by the camera whose camera flag & node's camera mask is true
 
virtual void setLocalZOrder (int localZOrder)
 LocalZOrder is the 'key' used to sort the node relative to its siblings. More...
 
virtual void setZOrder (int localZOrder)
virtual void _setLocalZOrder (int z)
local _setLocalZOrder ( local z)
virtual int getLocalZOrder () const
 Gets the local Z order of this node. More...
 
var getLocalZOrder ()
 Gets the local Z order of this node. More...
 
local getLocalZOrder ()
 Gets the local Z order of this node. More...
 
virtual int getZOrder () const
virtual float getGlobalZOrder () const
 Returns the Node's Global Z Order. More...
 
virtual void setScaleZ (float scaleZ)
 Changes the scale factor on Z axis of this node. More...
 
local setScaleZ ( local scaleZ)
 Changes the scale factor on Z axis of this node. More...
 
virtual float getScaleZ () const
 Returns the scale factor on Z axis of this node The scale factor on Z axis.
 
virtual void setPosition (const Vec2 &position)
 Sets the position (x,y) of the node in its parent's coordinate system. More...
 
virtual void setNormalizedPosition (const Vec2 &position)
 Sets the position (x,y) using values between 0 and 1. More...
 
var setNormalizedPosition ( var position)
 Sets the position (x,y) using values between 0 and 1. More...
 
local setNormalizedPosition ( local position)
 Sets the position (x,y) using values between 0 and 1. More...
 
virtual const Vec2getPosition () const
 Gets the position (x,y) of the node in its parent's coordinate system. More...
 
virtual const Vec2getNormalizedPosition () const
 Returns the normalized position. More...
 
virtual void setPosition (float x, float y)
 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 getPosition (float *x, float *y) const
 Gets position in a more efficient way, returns two number instead of a Vec2 object. More...
 
virtual void setPositionX (float x)
 Sets the x coordinate of the node in its parent's coordinate system. More...
 
virtual float getPositionX (void) const
 Gets the x coordinate of the node in its parent's coordinate system. More...
 
virtual void setPositionY (float y)
 Sets the y coordinate of the node in its parent's coordinate system. More...
 
virtual float getPositionY (void) const
 Gets the y coordinate of the node in its parent's coordinate system. More...
 
virtual void setPosition3D (const Vec3 &position)
 Sets the position (X, Y, and Z) in its parent's coordinate system. More...
 
virtual Vec3 getPosition3D () const
 Returns the position (X,Y,Z) in its parent's coordinate system. More...
 
virtual void setPositionZ (float positionZ)
 Sets the 'z' coordinate in the position. More...
 
local setPositionZ ( local positionZ)
 Sets the 'z' coordinate in the position. More...
 
virtual void setVertexZ (float vertexZ)
virtual float getPositionZ () const
 Gets position Z coordinate of this node. More...
 
var getVertexZ ()
 Gets position Z coordinate of this node. More...
 
local getPositionZ ()
 Gets position Z coordinate of this node. More...
 
virtual float getVertexZ () const
virtual void setSkewX (float skewX)
 Changes the X skew angle of the node in degrees. More...
 
local setSkewX ( local skewX)
 Changes the X skew angle of the node in degrees. More...
 
virtual float getSkewX () const
 Returns the X skew angle of the node in degrees. More...
 
var getSkewX ()
 Returns the X skew angle of the node in degrees. More...
 
local getSkewX ()
 Returns the X skew angle of the node in degrees. More...
 
virtual void setSkewY (float skewY)
 Changes the Y skew angle of the node in degrees. More...
 
local setSkewY ( local skewY)
 Changes the Y skew angle of the node in degrees. More...
 
virtual float getSkewY () const
 Returns the Y skew angle of the node in degrees. More...
 
var getSkewY ()
 Returns the Y skew angle of the node in degrees. More...
 
local getSkewY ()
 Returns the Y skew angle of the node in degrees. More...
 
virtual const Vec2getAnchorPoint () const
 Returns the anchor point in percent. More...
 
virtual const Vec2getAnchorPointInPoints () const
 Returns the anchorPoint in absolute pixels. More...
 
virtual const SizegetContentSize () const
 Returns the untransformed size of the node. More...
 
var getContentSize ()
 Returns the untransformed size of the node. More...
 
local getContentSize ()
 Returns the untransformed size of the node. More...
 
virtual void setVisible (bool visible)
 Sets whether the node is visible. More...
 
local setVisible ( local visible)
 Sets whether the node is visible. More...
 
virtual bool isVisible () const
 Determines if the node is visible. More...
 
virtual void setRotation (float 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 float getRotation () const
 Returns the rotation of the node in degrees. More...
 
var getRotation ()
 Returns the rotation of the node in degrees. More...
 
local getRotation ()
 Returns the rotation of the node in degrees. More...
 
virtual void setRotation3D (const Vec3 &rotation)
 Sets the rotation (X,Y,Z) in degrees. More...
 
local setRotation3D ( local rotation)
 Sets the rotation (X,Y,Z) in degrees. More...
 
virtual Vec3 getRotation3D () const
 Returns the rotation (X,Y,Z) in degrees. More...
 
virtual void setRotationQuat (const Quaternion &quat)
 Set rotation by quaternion. More...
 
local setRotationQuat ( local quat)
 Set rotation by quaternion. More...
 
virtual Quaternion getRotationQuat () const
 Return the rotation by quaternion, Note that when _rotationZ_X == _rotationZ_Y, the returned quaternion equals to RotationZ_X * RotationY * RotationX, The rotation in quaternion.
 
virtual void setRotationSkewX (float rotationX)
 Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew. More...
 
local setRotationSkewX ( local rotationX)
 Sets the X rotation (angle) of the node in degrees which performs a horizontal rotational skew. More...
 
virtual void setRotationX (float rotationX)
var setRotationX ( var rotationX)
local setRotationX ( local rotationX)
virtual float getRotationSkewX () const
 Gets the X rotation (angle) of the node in degrees which performs a horizontal rotation skew. More...
 
local getRotationSkewX ()
 Gets the X rotation (angle) of the node in degrees which performs a horizontal rotation skew. More...
 
virtual float getRotationX () const
virtual void setRotationSkewY (float 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 setRotationY (float rotationY)
local setRotationY ( local rotationY)
virtual float getRotationSkewY () const
 Gets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew. More...
 
local getRotationSkewY ()
 Gets the Y rotation (angle) of the node in degrees which performs a vertical rotational skew. More...
 
virtual float getRotationY () const
void setOrderOfArrival (int orderOfArrival)
 Sets the arrival order when this node has a same ZOrder with other children. More...
 
int getOrderOfArrival () const
 Returns the arrival order, indicates which children is added previously. More...
 
void setGLServerState (int serverState)
var setGLServerState ( var serverState)
int getGLServerState () const
virtual void ignoreAnchorPointForPosition (bool ignore)
 Sets whether the anchor point will be (0,0) when you position this node. More...
 
virtual bool isIgnoreAnchorPointForPosition () const
 Gets whether the anchor point will be (0,0) when you position this node. More...
 
virtual void addChild (Node *child)
 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 localZOrder)
 Adds a child to the container with a local z-order. More...
 
local addChild ( local child, local localZOrder)
 Adds a child to the container with a local z-order. More...
 
virtual void addChild (Node *child, int localZOrder, int tag)
 Adds a child to the container with z order and tag. More...
 
local addChild ( local child, local localZOrder, local tag)
 Adds a child to the container with z order and tag. More...
 
virtual void addChild (Node *child, int localZOrder, const std::string &name)
 Adds a child to the container with z order and tag. More...
 
local addChild ( local child, local localZOrder, local name)
 Adds a child to the container with z order and tag. More...
 
virtual NodegetChildByTag (int tag) const
 Gets a child from the container with its tag. More...
 
template<typename T >
getChildByTag (int tag) const
 Gets a child from the container with its tag that can be cast to Type T. More...
 
template<typename T >
var getChildByTag ( var tag)
 Gets a child from the container with its tag that can be cast to Type T. More...
 
template<typename T >
local getChildByTag ( local tag)
 Gets a child from the container with its tag that can be cast to Type T. More...
 
virtual NodegetChildByName (const std::string &name) const
 Gets a child from the container with its name. More...
 
template<typename T >
getChildByName (const std::string &name) const
 Gets a child from the container with its name that can be cast to Type T. More...
 
virtual void enumerateChildren (const std::string &name, std::function< bool(Node *node)> callback) const
 Search the children of the receiving node to perform processing for nodes which share a name. More...
 
virtual Vector< Node * > & getChildren ()
 Returns the array of the node's children. More...
 
local getChildren ()
 Returns the array of the node's children. More...
 
virtual const Vector< Node * > & getChildren () const
local getChildren ()
virtual ssize_t getChildrenCount () const
 Returns the amount of children. More...
 
var getChildrenCount ()
 Returns the amount of children. More...
 
local getChildrenCount ()
 Returns the amount of children. More...
 
virtual void setParent (Node *parent)
 Sets the parent node. More...
 
local setParent ( local parent)
 Sets the parent node. More...
 
virtual NodegetParent ()
 Returns a pointer to the parent node. More...
 
virtual const NodegetParent () const
var getParent ()
local getParent ()
virtual void removeFromParent ()
 Removes this node itself from its parent node with a cleanup. More...
 
var removeFromParent ()
 Removes this node itself from its parent node with a cleanup. More...
 
local removeFromParent ()
 Removes this node itself from its parent node with a cleanup. More...
 
virtual void removeFromParentAndCleanup (bool cleanup)
 Removes this node itself from its parent node. More...
 
local removeFromParent ( local cleanup)
 Removes this node itself from its parent node. More...
 
virtual void removeChild (Node *child, bool cleanup=true)
 Removes a child from the container. More...
 
virtual void removeChildByTag (int tag, bool cleanup=true)
 Removes a child from the container by tag value. More...
 
var removeChildByTag ( var tag, var true)
 Removes a child from the container by tag value. More...
 
local removeChildByTag ( local tag, local true)
 Removes a child from the container by tag value. More...
 
virtual void removeChildByName (const std::string &name, bool cleanup=true)
 Removes a child from the container by tag value. More...
 
var removeChildByName ( var name, var true)
 Removes a child from the container by tag value. More...
 
local removeChildByName ( local name, local true)
 Removes a child from the container by tag value. More...
 
virtual void removeAllChildren ()
 Removes all children from the container with a cleanup.
 
var removeAllChildren ()
 Removes all children from the container with a cleanup.
 
local removeAllChildren ()
 Removes all children from the container with a cleanup.
 
virtual void removeAllChildrenWithCleanup (bool cleanup)
 Removes all children from the container, and do a cleanup to all running actions depending on the cleanup parameter. More...
 
local removeAllChildren ( 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 localZOrder)
 Reorders a child according to a new z value. More...
 
virtual void 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 int getTag () const
 Returns a tag that is used to identify the node easily. More...
 
var getTag ()
 Returns a tag that is used to identify the node easily. More...
 
local getTag ()
 Returns a tag that is used to identify the node easily. More...
 
virtual void setTag (int tag)
 Changes the tag that is used to identify the node easily. More...
 
local setTag ( local tag)
 Changes the tag that is used to identify the node easily. More...
 
virtual const std::string & getName () const
 Returns a string that is used to identify the node. More...
 
local getName ()
 Returns a string that is used to identify the node. More...
 
virtual void setName (const std::string &name)
 Changes the name that is used to identify the node easily. More...
 
var setName ( var name)
 Changes the name that is used to identify the node easily. More...
 
local setName ( local name)
 Changes the name that is used to identify the node easily. More...
 
virtual void * getUserData ()
 Returns a custom user data pointer. More...
 
virtual const void * getUserData () const
virtual void setUserData (void *userData)
 Sets a custom user data pointer. More...
 
virtual RefgetUserObject ()
 Returns a user assigned Object. More...
 
virtual const RefgetUserObject () const
virtual void setUserObject (Ref *userObject)
 Returns a user assigned Object. More...
 
local setUserObject ( local userObject)
 Returns a user assigned Object. More...
 
GLProgramgetGLProgram () const
 Return the GLProgram (shader) currently used for this node. More...
 
var getGLProgram ()
 Return the GLProgram (shader) currently used for this node. More...
 
local getGLProgram ()
 Return the GLProgram (shader) currently used for this node. More...
 
GLProgramgetShaderProgram () const
var getShaderProgram ()
local getShaderProgram ()
void setShaderProgram (GLProgram *glprogram)
var setShaderProgram ( var glprogram)
local setShaderProgram ( local glprogram)
GLProgramStategetGLProgramState () const
 Return the GLProgramState currently used for this node. More...
 
var getGLProgramState ()
 Return the GLProgramState currently used for this node. More...
 
local getGLProgramState ()
 Return the GLProgramState currently used for this node. More...
 
virtual void onEnter ()
 Event callback that is invoked every time when Node enters the 'stage'. More...
 
virtual void onEnterTransitionDidFinish ()
 Event callback that is invoked when the Node enters in the 'stage'. More...
 
virtual void onExit ()
 Event callback that is invoked every time the Node leaves the 'stage'. More...
 
virtual void onExitTransitionDidStart ()
 Event callback that is called every time the Node leaves the 'stage'. More...
 
virtual void setActionManager (ActionManager *actionManager)
 Sets the ActionManager object that is used by all actions. More...
 
var setActionManager ( var actionManager)
 Sets the ActionManager object that is used by all actions. More...
 
local setActionManager ( local actionManager)
 Sets the ActionManager object that is used by all actions. More...
 
virtual ActionManagergetActionManager ()
 Gets the ActionManager object that is used by all actions. More...
 
local getActionManager ()
 Gets the ActionManager object that is used by all actions. More...
 
virtual const ActionManagergetActionManager () const
local getActionManager ()
virtual Action * runAction (Action *action)
 Executes an action, and returns the action that is executed. More...
 
var runAction ( var action)
 Executes an action, and returns the action that is executed. More...
 
local runAction ( local action)
 Executes an action, and returns the action that is executed. More...
 
void stopAllActions ()
 Stops and removes all actions from the running action list .
 
var stopAllActions ()
 Stops and removes all actions from the running action list .
 
local stopAllActions ()
 Stops and removes all actions from the running action list .
 
void stopAction (Action *action)
 Stops and removes an action from the running action list. More...
 
var stopAction ( var action)
 Stops and removes an action from the running action list. More...
 
local stopAction ( local action)
 Stops and removes an action from the running action list. More...
 
void stopActionByTag (int tag)
 Removes an action from the running action list by its tag. More...
 
var stopActionByTag ( var tag)
 Removes an action from the running action list by its tag. More...
 
local stopActionByTag ( local tag)
 Removes an action from the running action list by its tag. More...
 
void stopAllActionsByTag (int tag)
 Removes all actions from the running action list by its tag. More...
 
var stopAllActionsByTag ( var tag)
 Removes all actions from the running action list by its tag. More...
 
local stopAllActionsByTag ( local tag)
 Removes all actions from the running action list by its tag. More...
 
void stopActionsByFlags (unsigned int flags)
 Removes all actions from the running action list by its flags. More...
 
Action * getActionByTag (int tag)
 Gets an action from the running action list by its tag. More...
 
ssize_t getNumberOfRunningActions () const
 Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays). More...
 
ssize_t numberOfRunningActions () const
local numberOfRunningActions ()
virtual void setScheduler (Scheduler *scheduler)
 Sets a Scheduler object that is used to schedule all "updates" and timers. More...
 
virtual SchedulergetScheduler ()
 Gets a Sheduler object. More...
 
virtual const SchedulergetScheduler () const
local getScheduler ()
bool isScheduled (SEL_SCHEDULE selector)
 Checks whether a selector is scheduled. More...
 
bool isScheduled (const std::string &key)
 Checks whether a lambda function is scheduled. More...
 
void scheduleUpdate (void)
 Schedules the "update" method. More...
 
void scheduleUpdateWithPriority (int priority)
 Schedules the "update" method with a custom priority. More...
 
void unscheduleUpdate (void)
void schedule (SEL_SCHEDULE selector, float interval, unsigned int repeat, float delay)
 Schedules a custom selector. More...
 
void schedule (SEL_SCHEDULE selector, float interval)
 Schedules a custom selector with an interval time in seconds. More...
 
void scheduleOnce (SEL_SCHEDULE selector, float delay)
 Schedules a selector that runs only once, with a delay of 0 or larger The SEL_SCHEDULE selector to be scheduled. More...
 
void scheduleOnce (const std::function< void(float)> &callback, float delay, const std::string &key)
 Schedules a lambda function that runs only once, with a delay of 0 or larger The lambda function to be scheduled. More...
 
void schedule (SEL_SCHEDULE selector)
 Schedules a custom selector, the scheduled selector will be ticked every frame. More...
 
void schedule (const std::function< void(float)> &callback, const std::string &key)
 Schedules a lambda function. More...
 
void schedule (const std::function< void(float)> &callback, float interval, const std::string &key)
 Schedules a lambda function. More...
 
void schedule (const std::function< void(float)> &callback, float interval, unsigned int repeat, float delay, const std::string &key)
 Schedules a lambda function. More...
 
var schedule ( var callback, var interval, var repeat, var delay, var key)
 Schedules a lambda function. More...
 
void unschedule (SEL_SCHEDULE selector)
 Unschedules a custom selector. More...
 
var unschedule ( var selector)
 Unschedules a custom selector. More...
 
void unschedule (const std::string &key)
 Unschedules a lambda function. More...
 
var unschedule ( var key)
 Unschedules a lambda function. More...
 
void unscheduleAllCallbacks ()
 Unschedule all scheduled selectors and lambda functions: custom selectors, and the 'update' selector and lambda functions.
 
var unscheduleAllCallbacks ()
 Unschedule all scheduled selectors and lambda functions: custom selectors, and the 'update' selector and lambda functions.
 
void unscheduleAllSelectors ()
var unscheduleAllSelectors ()
local unscheduleAllSelectors ()
virtual void resume (void)
 Resumes all scheduled selectors, actions and event listeners. More...
 
local resume ()
 Resumes all scheduled selectors, actions and event listeners. More...
 
virtual void pause (void)
 Pauses all scheduled selectors, actions and event listeners. More...
 
local pause ()
 Pauses all scheduled selectors, actions and event listeners. More...
 
void resumeSchedulerAndActions ()
 Resumes all scheduled selectors, actions and event listeners. More...
 
void pauseSchedulerAndActions ()
 Pauses all scheduled selectors, actions and event listeners. More...
 
var pauseSchedulerAndActions ()
 Pauses all scheduled selectors, actions and event listeners. More...
 
local pauseSchedulerAndActions ()
 Pauses all scheduled selectors, actions and event listeners. More...
 
virtual void update (float delta)
 Update method will be called automatically every frame if "scheduleUpdate" is called, and the node is "live".
 
var update ( var delta)
 Update method will be called automatically every frame if "scheduleUpdate" is called, and the node is "live".
 
local update ( local delta)
 Update method will be called automatically every frame if "scheduleUpdate" is called, and the node is "live".
 
virtual void updateTransform ()
 Calls children's updateTransform() method recursively. More...
 
virtual const Mat4getNodeToParentTransform () const
 Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates. More...
 
virtual AffineTransform getNodeToParentAffineTransform () const
local getNodeToParentAffineTransform ()
virtual Mat4 getNodeToParentTransform (Node *ancestor) const
 Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates. More...
 
local getNodeToParentTransform ( local ancestor)
 Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates. More...
 
virtual AffineTransform getNodeToParentAffineTransform (Node *ancestor) const
 Returns the affine transform matrix that transform the node's (local) space coordinates into the parent's space coordinates. More...
 
local getNodeToParentAffineTransform ( local ancestor)
 Returns the affine transform matrix that transform the node's (local) space coordinates into the parent's space coordinates. More...
 
virtual void setNodeToParentTransform (const Mat4 &transform)
 Sets the transformation matrix manually. More...
 
var setNodeToParentTransform ( var transform)
 Sets the transformation matrix manually. More...
 
local setNodeToParentTransform ( local transform)
 Sets the transformation matrix manually. More...
 
virtual AffineTransform nodeToParentTransform () const
local nodeToParentTransform ()
virtual const Mat4getParentToNodeTransform () const
 Returns the matrix that transform parent's space coordinates to the node's (local) space coordinates. More...
 
var getParentToNodeTransform ()
 Returns the matrix that transform parent's space coordinates to the node's (local) space coordinates. More...
 
local getParentToNodeTransform ()
 Returns the matrix that transform parent's space coordinates to the node's (local) space coordinates. More...
 
virtual AffineTransform getParentToNodeAffineTransform () const
local getParentToNodeAffineTransform ()
virtual AffineTransform parentToNodeTransform () const
local parentToNodeTransform ()
virtual Mat4 getNodeToWorldTransform () const
 Returns the world affine transform matrix. More...
 
var getNodeToWorldTransform ()
 Returns the world affine transform matrix. More...
 
local getNodeToWorldTransform ()
 Returns the world affine transform matrix. More...
 
virtual AffineTransform getNodeToWorldAffineTransform () const
local getNodeToWorldAffineTransform ()
virtual AffineTransform nodeToWorldTransform () const
local nodeToWorldTransform ()
virtual Mat4 getWorldToNodeTransform () const
 Returns the inverse world affine transform matrix. More...
 
var getWorldToNodeTransform ()
 Returns the inverse world affine transform matrix. More...
 
local getWorldToNodeTransform ()
 Returns the inverse world affine transform matrix. More...
 
virtual AffineTransform getWorldToNodeAffineTransform () const
local getWorldToNodeAffineTransform ()
virtual AffineTransform worldToNodeTransform () const
local worldToNodeTransform ()
Vec2 convertToNodeSpace (const Vec2 &worldPoint) const
 Converts a Vec2 to node (local) space coordinates. More...
 
Vec2 convertToWorldSpace (const Vec2 &nodePoint) const
 Converts a Vec2 to world space coordinates. More...
 
Vec2 convertToNodeSpaceAR (const Vec2 &worldPoint) const
 Converts a Vec2 to node (local) space coordinates. More...
 
Vec2 convertToWorldSpaceAR (const Vec2 &nodePoint) const
 Converts a local Vec2 to world space coordinates.The result is in Points. More...
 
Vec2 convertTouchToNodeSpace (Touch *touch) const
 Convenience methods which take a Touch instead of Vec2. More...
 
var convertTouchToNodeSpace ( var touch)
 Convenience methods which take a Touch instead of Vec2. More...
 
local convertTouchToNodeSpace ( local touch)
 Convenience methods which take a Touch instead of Vec2. More...
 
Vec2 convertTouchToNodeSpaceAR (Touch *touch) const
 Converts a Touch (world coordinates) into a local coordinate. More...
 
void setAdditionalTransform (Mat4 *additionalTransform)
 Sets an additional transform matrix to the node. More...
 
void setAdditionalTransform (const AffineTransform &additionalTransform)
var setAdditionalTransform ( var additionalTransform)
local setAdditionalTransform ( local additionalTransform)
Component * getComponent (const std::string &name)
 Gets a component by its name. More...
 
var getComponent ( var name)
 Gets a component by its name. More...
 
local getComponent ( local name)
 Gets a component by its name. More...
 
virtual bool addComponent (Component *component)
 Adds a component. More...
 
virtual bool removeComponent (const std::string &name)
 Removes a component by its name. More...
 
virtual bool removeComponent (Component *component)
 Removes a component by its pointer. More...
 
local removeComponent ( local component)
 Removes a component by its pointer. More...
 
virtual void removeAllComponents ()
 Removes all components.
 
var removeAllComponents ()
 Removes all components.
 
local removeAllComponents ()
 Removes all components.
 
virtual std::string getDescription () const
 Gets the description string. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Static Public Member Functions

static Scale9Spritecreate ()
 Create an empty Scale9Sprite. More...
 
var create ()
 Create an empty Scale9Sprite. More...
 
local create ()
 Create an empty Scale9Sprite. More...
 
static Scale9Spritecreate (const std::string &file, const Rect &rect, const Rect &capInsets)
 Creates a 9-slice sprite with a texture file, a delimitation zone and with the specified cap insets. More...
 
static Scale9Spritecreate (const Rect &capInsets, const std::string &file)
 Creates a 9-slice sprite with a texture file. More...
 
static Scale9Spritecreate (const std::string &file, const Rect &rect)
 Creates a 9-slice sprite with a texture file and a delimitation zone. More...
 
static Scale9Spritecreate (const std::string &file)
 Creates a 9-slice sprite with a texture file. More...
 
static Scale9SpritecreateWithSpriteFrame (SpriteFrame *spriteFrame)
 Creates a 9-slice sprite with an sprite frame. More...
 
static Scale9SpritecreateWithSpriteFrame (SpriteFrame *spriteFrame, const Rect &capInsets)
 Creates a 9-slice sprite with an sprite frame and capInsets. More...
 
var createWithSpriteFrame ( var spriteFrame, var capInsets)
 Creates a 9-slice sprite with an sprite frame and capInsets. More...
 
local createWithSpriteFrame ( local spriteFrame, local capInsets)
 Creates a 9-slice sprite with an sprite frame and capInsets. More...
 
static Scale9SpritecreateWithSpriteFrameName (const std::string &spriteFrameName)
 Creates a 9-slice sprite with an sprite frame's name. More...
 
var createWithSpriteFrameName ( var spriteFrameName)
 Creates a 9-slice sprite with an sprite frame's name. More...
 
local createWithSpriteFrameName ( local spriteFrameName)
 Creates a 9-slice sprite with an sprite frame's name. More...
 
static Scale9SpritecreateWithSpriteFrameName (const std::string &spriteFrameName, const Rect &capInsets)
 Creates a 9-slice sprite with an sprite frame's name and capInsets. More...
 
- Static Public Member Functions inherited from Node
static Nodecreate ()
 Allocates and initializes a node. More...
 
var create ()
 Allocates and initializes a node. More...
 
local create ()
 Allocates and initializes a node. More...
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
- Static Public Attributes inherited from Node
static const int INVALID_TAG = -1
 Default tag used for all the nodes.
 
var INVALID_TAG = -1
 Default tag used for all the nodes.
 
local INVALID_TAG = -1
 Default tag used for all the nodes.
 

Detailed Description

A 9-slice sprite for cocos2d-x.

9-slice scaling allows you to specify how scaling is applied to specific areas of a sprite. With 9-slice scaling (3x3 grid), you can ensure that the sprite does not become distorted when scaled. When you set _scale9Enabled to false, then you could call scale9Sprite->getSprite() to return the inner Sprite pointer. Then you could call any methods of Sprite class with the return pointers.

Member Function Documentation

static Scale9Sprite* create ( )
static

Create an empty Scale9Sprite.

A Scale9Sprite instance.

var create ( )
static

Create an empty Scale9Sprite.

A Scale9Sprite instance.

local create ( )
static

Create an empty Scale9Sprite.

A Scale9Sprite instance.

static Scale9Sprite* create ( const std::string &  file,
const Rect rect,
const Rect capInsets 
)
static

Creates a 9-slice sprite with a texture file, a delimitation zone and with the specified cap insets.

A texture file name. A delimitation zone. A specified cap insets. A Scale9Sprite instance.

var create ( var  file,
var  rect,
var  capInsets 
)
static

Creates a 9-slice sprite with a texture file, a delimitation zone and with the specified cap insets.

A texture file name. A delimitation zone. A specified cap insets. A Scale9Sprite instance.

local create ( local  file,
local  rect,
local  capInsets 
)
static

Creates a 9-slice sprite with a texture file, a delimitation zone and with the specified cap insets.

A texture file name. A delimitation zone. A specified cap insets. A Scale9Sprite instance.

static Scale9Sprite* create ( const Rect capInsets,
const std::string &  file 
)
static

Creates a 9-slice sprite with a texture file.

The whole texture will be broken down into a 3×3 grid of equal blocks. A specified cap insets. A texture file name. A Scale9Sprite instance.

var create ( var  capInsets,
var  file 
)
static

Creates a 9-slice sprite with a texture file.

The whole texture will be broken down into a 3×3 grid of equal blocks. A specified cap insets. A texture file name. A Scale9Sprite instance.

local create ( local  capInsets,
local  file 
)
static

Creates a 9-slice sprite with a texture file.

The whole texture will be broken down into a 3×3 grid of equal blocks. A specified cap insets. A texture file name. A Scale9Sprite instance.

static Scale9Sprite* create ( const std::string &  file,
const Rect rect 
)
static

Creates a 9-slice sprite with a texture file and a delimitation zone.

The texture will be broken down into a 3×3 grid of equal blocks. A texture file name.

var create ( var  file,
var  rect 
)
static

Creates a 9-slice sprite with a texture file and a delimitation zone.

The texture will be broken down into a 3×3 grid of equal blocks. A texture file name.

local create ( local  file,
local  rect 
)
static

Creates a 9-slice sprite with a texture file and a delimitation zone.

The texture will be broken down into a 3×3 grid of equal blocks. A texture file name.

static Scale9Sprite* create ( const std::string &  file)
static

Creates a 9-slice sprite with a texture file.

The whole texture will be broken down into a 3×3 grid of equal blocks. A texture file name. A Scale9Sprite instance.

var create ( var  file)
static

Creates a 9-slice sprite with a texture file.

The whole texture will be broken down into a 3×3 grid of equal blocks. A texture file name. A Scale9Sprite instance.

local create ( local  file)
static

Creates a 9-slice sprite with a texture file.

The whole texture will be broken down into a 3×3 grid of equal blocks. A texture file name. A Scale9Sprite instance.

static Scale9Sprite*
createWithSpriteFrame
( SpriteFrame spriteFrame)
static

Creates a 9-slice sprite with an sprite frame.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. A Scale9Sprite instance.

var createWithSpriteFrame ( var  spriteFrame)
static

Creates a 9-slice sprite with an sprite frame.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. A Scale9Sprite instance.

local createWithSpriteFrame ( local  spriteFrame)
static

Creates a 9-slice sprite with an sprite frame.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. A Scale9Sprite instance.

static Scale9Sprite*
createWithSpriteFrame
( SpriteFrame spriteFrame,
const Rect capInsets 
)
static

Creates a 9-slice sprite with an sprite frame and capInsets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. The capInsets A Scale9Sprite instance.

var createWithSpriteFrame ( var  spriteFrame,
var  capInsets 
)
static

Creates a 9-slice sprite with an sprite frame and capInsets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. The capInsets A Scale9Sprite instance.

local createWithSpriteFrame ( local  spriteFrame,
local  capInsets 
)
static

Creates a 9-slice sprite with an sprite frame and capInsets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. The capInsets A Scale9Sprite instance.

static Scale9Sprite*
createWithSpriteFrameName
( const std::string &  spriteFrameName)
static

Creates a 9-slice sprite with an sprite frame's name.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. A Scale9Sprite instance.

var createWithSpriteFrameName ( var  spriteFrameName)
static

Creates a 9-slice sprite with an sprite frame's name.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. A Scale9Sprite instance.

local createWithSpriteFrameName ( local  spriteFrameName)
static

Creates a 9-slice sprite with an sprite frame's name.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. A Scale9Sprite instance.

static Scale9Sprite*
createWithSpriteFrameName
( const std::string &  spriteFrameName,
const Rect capInsets 
)
static

Creates a 9-slice sprite with an sprite frame's name and capInsets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. The values to use for the cap insets. A Scale9Sprite instance.

var createWithSpriteFrameName ( var  spriteFrameName,
var  capInsets 
)
static

Creates a 9-slice sprite with an sprite frame's name and capInsets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. The values to use for the cap insets. A Scale9Sprite instance.

local createWithSpriteFrameName ( local  spriteFrameName,
local  capInsets 
)
static

Creates a 9-slice sprite with an sprite frame's name and capInsets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. A sprite frame pointer. The values to use for the cap insets. A Scale9Sprite instance.

virtual bool initWithFile ( const std::string &  file,
const Rect rect,
const Rect capInsets 
)
virtual

Initializes a 9-slice sprite with a texture file, a delimitation zone and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. The rectangle that describes the sub-part of the texture that is the whole image. If the shape is the whole texture, set this to the texture's full rect. The values to use for the cap insets. True if initialize success, false otherwise.

var initWithFile ( var  file,
var  rect,
var  capInsets 
)
virtual

Initializes a 9-slice sprite with a texture file, a delimitation zone and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. The rectangle that describes the sub-part of the texture that is the whole image. If the shape is the whole texture, set this to the texture's full rect. The values to use for the cap insets. True if initialize success, false otherwise.

local initWithFile ( local  file,
local  rect,
local  capInsets 
)
virtual

Initializes a 9-slice sprite with a texture file, a delimitation zone and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. The rectangle that describes the sub-part of the texture that is the whole image. If the shape is the whole texture, set this to the texture's full rect. The values to use for the cap insets. True if initialize success, false otherwise.

virtual bool initWithFile ( const std::string &  file,
const Rect rect 
)
virtual

Initializes a 9-slice sprite with a texture file, a delimitation zone.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. The rectangle that describes the sub-part of the texture that is the whole image. If the shape is the whole texture, set this to the texture's full rect. True if initialize success, false otherwise.

var initWithFile ( var  file,
var  rect 
)
virtual

Initializes a 9-slice sprite with a texture file, a delimitation zone.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. The rectangle that describes the sub-part of the texture that is the whole image. If the shape is the whole texture, set this to the texture's full rect. True if initialize success, false otherwise.

local initWithFile ( local  file,
local  rect 
)
virtual

Initializes a 9-slice sprite with a texture file, a delimitation zone.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. The rectangle that describes the sub-part of the texture that is the whole image. If the shape is the whole texture, set this to the texture's full rect. True if initialize success, false otherwise.

virtual bool initWithFile ( const Rect capInsets,
const std::string &  file 
)
virtual

Initializes a 9-slice sprite with a texture file and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. The values to use for the cap insets. True if initialize success, false otherwise.

var initWithFile ( var  capInsets,
var  file 
)
virtual

Initializes a 9-slice sprite with a texture file and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. The values to use for the cap insets. True if initialize success, false otherwise.

local initWithFile ( local  capInsets,
local  file 
)
virtual

Initializes a 9-slice sprite with a texture file and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. The values to use for the cap insets. True if initialize success, false otherwise.

virtual bool initWithFile ( const std::string &  file)
virtual

Initializes a 9-slice sprite with a texture file.

The whole texture will be broken down into a 3×3 grid of equal blocks. Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. True if initializes success, false otherwise.

var initWithFile ( var  file)
virtual

Initializes a 9-slice sprite with a texture file.

The whole texture will be broken down into a 3×3 grid of equal blocks. Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. True if initializes success, false otherwise.

local initWithFile ( local  file)
virtual

Initializes a 9-slice sprite with a texture file.

The whole texture will be broken down into a 3×3 grid of equal blocks. Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The name of the texture file. True if initializes success, false otherwise.

virtual bool initWithSpriteFrame ( SpriteFrame spriteFrame,
const Rect capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite frame and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame object. The values to use for the cap insets. True if initializes success, false otherwise.

var initWithSpriteFrame ( var  spriteFrame,
var  capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite frame and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame object. The values to use for the cap insets. True if initializes success, false otherwise.

local initWithSpriteFrame ( local  spriteFrame,
local  capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite frame and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame object. The values to use for the cap insets. True if initializes success, false otherwise.

virtual bool initWithSpriteFrame ( SpriteFrame spriteFrame)
virtual

Initializes a 9-slice sprite with an sprite frame.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame object. True if initializes success, false otherwise.

var initWithSpriteFrame ( var  spriteFrame)
virtual

Initializes a 9-slice sprite with an sprite frame.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame object. True if initializes success, false otherwise.

local initWithSpriteFrame ( local  spriteFrame)
virtual

Initializes a 9-slice sprite with an sprite frame.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame object. True if initializes success, false otherwise.

virtual bool
initWithSpriteFrameName
( const std::string &  spriteFrameName,
const Rect capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite frame name and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame name. The values to use for the cap insets. True if initializes success, false otherwise.

var initWithSpriteFrameName ( var  spriteFrameName,
var  capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite frame name and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame name. The values to use for the cap insets. True if initializes success, false otherwise.

local initWithSpriteFrameName ( local  spriteFrameName,
local  capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite frame name and with the specified cap insets.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame name. The values to use for the cap insets. True if initializes success, false otherwise.

virtual bool
initWithSpriteFrameName
( const std::string &  spriteFrameName)
virtual

Initializes a 9-slice sprite with an sprite frame name.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame name. True if initializes success, false otherwise.

var initWithSpriteFrameName ( var  spriteFrameName)
virtual

Initializes a 9-slice sprite with an sprite frame name.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame name. True if initializes success, false otherwise.

local initWithSpriteFrameName ( local  spriteFrameName)
virtual

Initializes a 9-slice sprite with an sprite frame name.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite frame name. True if initializes success, false otherwise.

virtual bool init ( Sprite sprite,
const Rect rect,
bool  rotated,
const Rect capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite instance.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite instance. A delimitation zone. Whether the sprite is rotated or not. The values to use for the cap insets. True if initializes success, false otherwise.

var init ( var  sprite,
var  rect,
var  rotated,
var  capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite instance.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite instance. A delimitation zone. Whether the sprite is rotated or not. The values to use for the cap insets. True if initializes success, false otherwise.

local init ( local  sprite,
local  rect,
local  rotated,
local  capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite instance.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite instance. A delimitation zone. Whether the sprite is rotated or not. The values to use for the cap insets. True if initializes success, false otherwise.

virtual bool init ( Sprite sprite,
const Rect rect,
const Rect capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite instance.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite instance. A delimitation zone. The values to use for the cap insets. True if initializes success, false otherwise.

var init ( var  sprite,
var  rect,
var  capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite instance.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite instance. A delimitation zone. The values to use for the cap insets. True if initializes success, false otherwise.

local init ( local  sprite,
local  rect,
local  capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite instance.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too. The sprite instance. A delimitation zone. The values to use for the cap insets. True if initializes success, false otherwise.

virtual bool init ( Sprite sprite,
const Rect rect,
bool  rotated,
const Vec2 offset,
const Size originalSize,
const Rect capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite instance and several parameters Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract.

It respects the anchorPoint too. The sprite instance. A delimitation zone. Whether the sprite is rotated or not. The offset when slice the sprite. The original size of sprite. The values to use for the cap insets. True if initializes success, false otherwise.

var init ( var  sprite,
var  rect,
var  rotated,
var  offset,
var  originalSize,
var  capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite instance and several parameters Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract.

It respects the anchorPoint too. The sprite instance. A delimitation zone. Whether the sprite is rotated or not. The offset when slice the sprite. The original size of sprite. The values to use for the cap insets. True if initializes success, false otherwise.

local init ( local  sprite,
local  rect,
local  rotated,
local  offset,
local  originalSize,
local  capInsets 
)
virtual

Initializes a 9-slice sprite with an sprite instance and several parameters Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract.

It respects the anchorPoint too. The sprite instance. A delimitation zone. Whether the sprite is rotated or not. The offset when slice the sprite. The original size of sprite. The values to use for the cap insets. True if initializes success, false otherwise.

CC_DEPRECATED ( v3  )

Initializes a 9-slice sprite with a sprite batchnode.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too.

var CC_DEPRECATED ( var  )

Initializes a 9-slice sprite with a sprite batchnode.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too.

local CC_DEPRECATED ( local  )

Initializes a 9-slice sprite with a sprite batchnode.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too.

CC_DEPRECATED ( v3  )

Initializes a 9-slice sprite with a sprite batch node.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too.

var CC_DEPRECATED ( var  )

Initializes a 9-slice sprite with a sprite batch node.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too.

local CC_DEPRECATED ( local  )

Initializes a 9-slice sprite with a sprite batch node.

Once the sprite is created, you can then call its "setContentSize:" method to resize the sprite will all it's 9-slice goodness intract. It respects the anchorPoint too.

virtual void setBlendFunc ( const BlendFunc blendFunc)
overridevirtual

Sets the source blending function.

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

virtual const BlendFunc&
getBlendFunc
( ) const
overridevirtual

Returns the blending function that is currently being used.

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

Scale9Sprite*
resizableSpriteWithCapInsets
( const Rect capInsets) const

Creates and returns a new sprite object with the specified cap insets.

You use this method to add cap insets to a sprite or to change the existing cap insets of a sprite. In both cases, you get back a new image and the original sprite remains untouched. The values to use for the cap insets. A Scale9Sprite instance.

var resizableSpriteWithCapInsets ( var  capInsets)

Creates and returns a new sprite object with the specified cap insets.

You use this method to add cap insets to a sprite or to change the existing cap insets of a sprite. In both cases, you get back a new image and the original sprite remains untouched. The values to use for the cap insets. A Scale9Sprite instance.

local resizableSpriteWithCapInsets ( local  capInsets)

Creates and returns a new sprite object with the specified cap insets.

You use this method to add cap insets to a sprite or to change the existing cap insets of a sprite. In both cases, you get back a new image and the original sprite remains untouched. The values to use for the cap insets. A Scale9Sprite instance.

virtual bool updateWithSprite ( Sprite sprite,
const Rect rect,
bool  rotated,
const Rect capInsets 
)
virtual

Update Scale9Sprite with a specified sprite.

A sprite pointer. A delimitation zone. Whether the sprite is rotated or not. The Values to use for the cap insets. True if update success, false otherwise.

local updateWithSprite ( local  sprite,
local  rect,
local  rotated,
local  capInsets 
)
virtual

Update Scale9Sprite with a specified sprite.

A sprite pointer. A delimitation zone. Whether the sprite is rotated or not. The Values to use for the cap insets. True if update success, false otherwise.

virtual bool updateWithSprite ( Sprite sprite,
const Rect rect,
bool  rotated,
const Vec2 offset,
const Size originalSize,
const Rect capInsets 
)
virtual

Update Scale9Sprite with a specified sprite.

A sprite pointer. A delimitation zone. Whether the sprite is rotated or not. The offset when slice the sprite. The original size of the sprite. The Values to use for the cap insets. True if update success, false otherwise.

local updateWithSprite ( local  sprite,
local  rect,
local  rotated,
local  offset,
local  originalSize,
local  capInsets 
)
virtual

Update Scale9Sprite with a specified sprite.

A sprite pointer. A delimitation zone. Whether the sprite is rotated or not. The offset when slice the sprite. The original size of the sprite. The Values to use for the cap insets. True if update success, false otherwise.

CC_DEPRECATED ( v3  )

Update Scale9Sprite with a specified sprite.

Use

See also
updateWithSprite instead. A sprite pointer. A delimitation zone. Whether the sprite is rotated or not.、 The Values to use for the cap insets. True if update success, false otherwise.
var CC_DEPRECATED ( var  )

Update Scale9Sprite with a specified sprite.

Use

See also
updateWithSprite instead. A sprite pointer. A delimitation zone. Whether the sprite is rotated or not.、 The Values to use for the cap insets. True if update success, false otherwise.
local CC_DEPRECATED ( local  )

Update Scale9Sprite with a specified sprite.

Use

See also
updateWithSprite instead. A sprite pointer. A delimitation zone. Whether the sprite is rotated or not.、 The Values to use for the cap insets. True if update success, false otherwise.
virtual void setSpriteFrame ( SpriteFrame spriteFrame,
const Rect capInsets = Rect::ZERO 
)
virtual

Change inner sprite's sprite frame.

A sprite frame pointer. The values to use for the cap insets.

var setSpriteFrame ( var  spriteFrame,
var  capInsets = Rect::ZERO 
)
virtual

Change inner sprite's sprite frame.

A sprite frame pointer. The values to use for the cap insets.

local setSpriteFrame ( local  spriteFrame,
local  capInsets = Rect::ZERO 
)
virtual

Change inner sprite's sprite frame.

A sprite frame pointer. The values to use for the cap insets.

virtual void setContentSize ( const Size contentSize)
overridevirtual

Sets the untransformed size of the node.

The contentSize remains the same no matter the node is scaled or rotated. All nodes has a size. Layer and Scene has the same size of the screen. The untransformed size of the node.

Reimplemented from Node.

var setContentSize ( var  contentSize)
overridevirtual

Sets the untransformed size of the node.

The contentSize remains the same no matter the node is scaled or rotated. All nodes has a size. Layer and Scene has the same size of the screen. The untransformed size of the node.

Reimplemented from Node.

local setContentSize ( local  contentSize)
overridevirtual

Sets the untransformed size of the node.

The contentSize remains the same no matter the node is scaled or rotated. All nodes has a size. Layer and Scene has the same size of the screen. The untransformed size of the node.

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

Reimplemented from Node.

void setPreferredSize ( const Size size)

Change the prefered size of Scale9Sprite.

A delimitation zone.

var setPreferredSize ( var  size)

Change the prefered size of Scale9Sprite.

A delimitation zone.

local setPreferredSize ( local  size)

Change the prefered size of Scale9Sprite.

A delimitation zone.

Size getPreferredSize ( ) const

Query the Scale9Sprite's prefered size.

Scale9Sprite's prefered size.

var getPreferredSize ( )

Query the Scale9Sprite's prefered size.

Scale9Sprite's prefered size.

local getPreferredSize ( )

Query the Scale9Sprite's prefered size.

Scale9Sprite's prefered size.

Rect getCapInsets ( ) const

Query the Scale9Sprite's prefered size.

Scale9Sprite's cap inset.

var getCapInsets ( )

Query the Scale9Sprite's prefered size.

Scale9Sprite's cap inset.

local getCapInsets ( )

Query the Scale9Sprite's prefered size.

Scale9Sprite's cap inset.

void setInsetLeft ( float  leftInset)

Change the left sprite's cap inset.

The values to use for the cap inset.

var setInsetLeft ( var  leftInset)

Change the left sprite's cap inset.

The values to use for the cap inset.

local setInsetLeft ( local  leftInset)

Change the left sprite's cap inset.

The values to use for the cap inset.

float getInsetLeft ( ) const

Query the left sprite's cap inset.

The left sprite's cap inset.

var getInsetLeft ( )

Query the left sprite's cap inset.

The left sprite's cap inset.

local getInsetLeft ( )

Query the left sprite's cap inset.

The left sprite's cap inset.

void setInsetTop ( float  topInset)

Change the top sprite's cap inset.

The values to use for the cap inset.

var setInsetTop ( var  topInset)

Change the top sprite's cap inset.

The values to use for the cap inset.

local setInsetTop ( local  topInset)

Change the top sprite's cap inset.

The values to use for the cap inset.

float getInsetTop ( ) const

Query the top sprite's cap inset.

The top sprite's cap inset.

var getInsetTop ( )

Query the top sprite's cap inset.

The top sprite's cap inset.

local getInsetTop ( )

Query the top sprite's cap inset.

The top sprite's cap inset.

void setInsetRight ( float  rightInset)

Change the right sprite's cap inset.

The values to use for the cap inset.

var setInsetRight ( var  rightInset)

Change the right sprite's cap inset.

The values to use for the cap inset.

local setInsetRight ( local  rightInset)

Change the right sprite's cap inset.

The values to use for the cap inset.

float getInsetRight ( ) const

Query the right sprite's cap inset.

The right sprite's cap inset.

var getInsetRight ( )

Query the right sprite's cap inset.

The right sprite's cap inset.

local getInsetRight ( )

Query the right sprite's cap inset.

The right sprite's cap inset.

void setInsetBottom ( float  bottomInset)

Change the bottom sprite's cap inset.

The values to use for the cap inset.

var setInsetBottom ( var  bottomInset)

Change the bottom sprite's cap inset.

The values to use for the cap inset.

local setInsetBottom ( local  bottomInset)

Change the bottom sprite's cap inset.

The values to use for the cap inset.

float getInsetBottom ( ) const

Query the bottom sprite's cap inset.

The bottom sprite's cap inset.

var getInsetBottom ( )

Query the bottom sprite's cap inset.

The bottom sprite's cap inset.

local getInsetBottom ( )

Query the bottom sprite's cap inset.

The bottom sprite's cap inset.

void setScale9Enabled ( bool  enabled)

Toggle 9-slice feature.

If Scale9Sprite is 9-slice disabled, the Scale9Sprite will rendered as a normal sprite. True to enable 9-slice, false otherwise.

local setScale9Enabled ( local  enabled)

Toggle 9-slice feature.

If Scale9Sprite is 9-slice disabled, the Scale9Sprite will rendered as a normal sprite. True to enable 9-slice, false otherwise.

bool isScale9Enabled ( ) const

Query whether the Scale9Sprite is enable 9-slice or not.

True if 9-slice is enabled, false otherwise.

local isScale9Enabled ( )

Query whether the Scale9Sprite is enable 9-slice or not.

True if 9-slice is enabled, false otherwise.

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.

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.

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.

virtual void visit ( Renderer *  renderer,
const Mat4 parentTransform,
uint32_t  parentFlags 
)
overridevirtual

Visits this node's children and send their render command recursively.

A given renderer. A transform matrix. Renderer flag.

Reimplemented from Node.

var visit ( var  renderer,
var  parentTransform,
var  parentFlags 
)
overridevirtual

Visits this node's children and send their render command recursively.

A given renderer. A transform matrix. Renderer flag.

Reimplemented from Node.

local visit ( local  renderer,
local  parentTransform,
local  parentFlags 
)
overridevirtual

Visits this node's children and send their render command recursively.

A given renderer. A transform matrix. Renderer flag.

Reimplemented from Node.

virtual void updateDisplayedOpacity ( GLubyte  parentOpacity)
overridevirtual

Update the displayed opacity of node with it's parent opacity;.

Parameters
parentOpacityThe opacity of parent node.

Reimplemented from Node.

var updateDisplayedOpacity ( var  parentOpacity)
overridevirtual

Update the displayed opacity of node with it's parent opacity;.

Parameters
parentOpacityThe opacity of parent node.

Reimplemented from Node.

local updateDisplayedOpacity ( local  parentOpacity)
overridevirtual

Update the displayed opacity of node with it's parent opacity;.

Parameters
parentOpacityThe opacity of parent node.

Reimplemented from Node.

virtual void updateDisplayedColor ( const Color3B parentColor)
overridevirtual

Update node's displayed color with its parent color.

Parameters
parentColorA Color3B color value.

Reimplemented from Node.

var updateDisplayedColor ( var  parentColor)
overridevirtual

Update node's displayed color with its parent color.

Parameters
parentColorA Color3B color value.

Reimplemented from Node.

local updateDisplayedColor ( local  parentColor)
overridevirtual

Update node's displayed color with its parent color.

Parameters
parentColorA Color3B color value.

Reimplemented from Node.

virtual void setGLProgram ( GLProgram glprogram)
overridevirtual

Sets the shader program for this node.

Since v2.0, each rendering node must set its shader program. It should be set in initialize phase. The shader program.

Reimplemented from Node.

var setGLProgram ( var  glprogram)
overridevirtual

Sets the shader program for this node.

Since v2.0, each rendering node must set its shader program. It should be set in initialize phase. The shader program.

Reimplemented from Node.

local setGLProgram ( local  glprogram)
overridevirtual

Sets the shader program for this node.

Since v2.0, each rendering node must set its shader program. It should be set in initialize phase. The shader program.

Reimplemented from Node.

virtual void setGLProgramState ( GLProgramState glProgramState)
overridevirtual

Set the GLProgramState for this node.

The GLProgramState for this node.

Reimplemented from Node.

var setGLProgramState ( var  glProgramState)
overridevirtual

Set the GLProgramState for this node.

The GLProgramState for this node.

Reimplemented from Node.

local setGLProgramState ( local  glProgramState)
overridevirtual

Set the GLProgramState for this node.

The GLProgramState for this node.

Reimplemented from Node.

virtual void setFlippedX ( bool  flippedX)
virtual

Sets whether the widget should be flipped horizontally or not.

true if the widget should be flipped horizontally, false otherwise.

var setFlippedX ( var  flippedX)
virtual

Sets whether the widget should be flipped horizontally or not.

true if the widget should be flipped horizontally, false otherwise.

local setFlippedX ( local  flippedX)
virtual

Sets whether the widget should be flipped horizontally or not.

true if the widget should be flipped horizontally, false otherwise.

virtual bool isFlippedX ( ) const
virtual

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

It only flips the texture of the widget, and not the texture of the widget'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: widget->setScaleX(sprite->getScaleX() * -1); True if the widget is flipped horizontally, false otherwise.

var isFlippedX ( )
virtual

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

It only flips the texture of the widget, and not the texture of the widget'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: widget->setScaleX(sprite->getScaleX() * -1); True if the widget is flipped horizontally, false otherwise.

local isFlippedX ( )
virtual

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

It only flips the texture of the widget, and not the texture of the widget'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: widget->setScaleX(sprite->getScaleX() * -1); True if the widget is flipped horizontally, false otherwise.

virtual void setFlippedY ( bool  flippedY)
virtual

Sets whether the widget should be flipped vertically or not.

true if the widget should be flipped vertically, false otherwise.

var setFlippedY ( var  flippedY)
virtual

Sets whether the widget should be flipped vertically or not.

true if the widget should be flipped vertically, false otherwise.

local setFlippedY ( local  flippedY)
virtual

Sets whether the widget should be flipped vertically or not.

true if the widget should be flipped vertically, false otherwise.

virtual bool isFlippedY ( ) const
virtual

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

It only flips the texture of the widget, and not the texture of the widget'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: widget->setScaleY(widget->getScaleY() * -1); True if the widget is flipped vertically, flase otherwise.

var isFlippedY ( )
virtual

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

It only flips the texture of the widget, and not the texture of the widget'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: widget->setScaleY(widget->getScaleY() * -1); True if the widget is flipped vertically, flase otherwise.

local isFlippedY ( )
virtual

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

It only flips the texture of the widget, and not the texture of the widget'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: widget->setScaleY(widget->getScaleY() * -1); True if the widget is flipped vertically, flase otherwise.

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. The scale factor on X axis. 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. The scale factor on X axis. 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. The scale factor on X axis. 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. The scale factor on Y axis. 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. The scale factor on Y axis. 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. The scale factor on Y axis. 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. The scale factor for X, Y and Z axis. 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. The scale factor for X, Y and Z axis. 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. The scale factor for X, Y and Z axis. 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. The scale factor on X axis. The scale factor on Y axis. 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. The scale factor on X axis. The scale factor on Y axis. 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. The scale factor on X axis. The scale factor on Y axis. The physics body doesn't support this.

Reimplemented from Node.

virtual float getScale ( ) const
overridevirtual

Gets the scale factor of the node, when X and Y have the same scale factor.

Assert when _scaleX != _scaleY The scale factor of the node.

Reimplemented from Node.

var getScale ( )
overridevirtual

Gets the scale factor of the node, when X and Y have the same scale factor.

Assert when _scaleX != _scaleY The scale factor of the node.

Reimplemented from Node.

local getScale ( )
overridevirtual

Gets the scale factor of the node, when X and Y have the same scale factor.

Assert when _scaleX != _scaleY The scale factor of the node.

Reimplemented from Node.

virtual void setCameraMask ( unsigned short  mask,
bool  applyChildren = true 
)
overridevirtual

Modify the camera mask for current node.

If applyChildren is true, then it will modify the camera mask of its children recursively.

Parameters
maskA unsigned short bit for mask.
applyChildrenA boolean value to determine whether the mask bit should apply to its children or not.

Reimplemented from Node.

var setCameraMask ( var  mask,
var  applyChildren = true 
)
overridevirtual

Modify the camera mask for current node.

If applyChildren is true, then it will modify the camera mask of its children recursively.

Parameters
maskA unsigned short bit for mask.
applyChildrenA boolean value to determine whether the mask bit should apply to its children or not.

Reimplemented from Node.

local setCameraMask ( local  mask,
local  applyChildren = true 
)
overridevirtual

Modify the camera mask for current node.

If applyChildren is true, then it will modify the camera mask of its children recursively.

Parameters
maskA unsigned short bit for mask.
applyChildrenA boolean value to determine whether the mask bit should apply to its children or not.

Reimplemented from Node.

virtual void setGlobalZOrder ( float  globalZOrder)
overridevirtual

Defines the oder in which the nodes are renderer.

Nodes that have a Global Z Order lower, are renderer first.

In case two or more nodes have the same Global Z Order, the oder is not guaranteed. The only exception if the Nodes have a Global Z Order == 0. In that case, the Scene Graph order is used.

By default, all nodes have a Global Z Order = 0. That means that by default, the Scene Graph order is used to render the nodes.

Global Z Order is useful when you need to render nodes in an order different than the Scene Graph order.

Limitations: Global Z Order can't be used by Nodes that have SpriteBatchNode as one of their ancestors. And if ClippingNode is one of the ancestors, then "global Z order" will be relative to the ClippingNode. The global Z order value.

Reimplemented from Node.

var setGlobalZOrder ( var  globalZOrder)
overridevirtual

Defines the oder in which the nodes are renderer.

Nodes that have a Global Z Order lower, are renderer first.

In case two or more nodes have the same Global Z Order, the oder is not guaranteed. The only exception if the Nodes have a Global Z Order == 0. In that case, the Scene Graph order is used.

By default, all nodes have a Global Z Order = 0. That means that by default, the Scene Graph order is used to render the nodes.

Global Z Order is useful when you need to render nodes in an order different than the Scene Graph order.

Limitations: Global Z Order can't be used by Nodes that have SpriteBatchNode as one of their ancestors. And if ClippingNode is one of the ancestors, then "global Z order" will be relative to the ClippingNode. The global Z order value.

Reimplemented from Node.

local setGlobalZOrder ( local  globalZOrder)
overridevirtual

Defines the oder in which the nodes are renderer.

Nodes that have a Global Z Order lower, are renderer first.

In case two or more nodes have the same Global Z Order, the oder is not guaranteed. The only exception if the Nodes have a Global Z Order == 0. In that case, the Scene Graph order is used.

By default, all nodes have a Global Z Order = 0. That means that by default, the Scene Graph order is used to render the nodes.

Global Z Order is useful when you need to render nodes in an order different than the Scene Graph order.

Limitations: Global Z Order can't be used by Nodes that have SpriteBatchNode as one of their ancestors. And if ClippingNode is one of the ancestors, then "global Z order" will be relative to the ClippingNode. The global Z order value.

Reimplemented from Node.

void setRenderingType ( RenderingType  type)

Set the slice sprite rendering type.

When setting to SIMPLE, only 4 vertexes is used to rendering. otherwise 16 vertexes will be used to rendering.

See also
RenderingType
var setRenderingType ( var  type)

Set the slice sprite rendering type.

When setting to SIMPLE, only 4 vertexes is used to rendering. otherwise 16 vertexes will be used to rendering.

See also
RenderingType
local setRenderingType ( local  type)

Set the slice sprite rendering type.

When setting to SIMPLE, only 4 vertexes is used to rendering. otherwise 16 vertexes will be used to rendering.

See also
RenderingType

The documentation for this class was generated from the following file: