Skip to main content

CCScale9Sprite

CCScale9Sprite

Cocos2D

This is a special sprite container that represents a 9 point sprite region, where 8 of hte points are along the perimeter, and the 9th is the center area. This special sprite is capable of resizing itself to arbitrary scales.

Inheritance: System.Object → Cocos2D.CCNode

Implements: Cocos2D.ICCSelectorProtocol, Cocos2D.ICCFocusable, Cocos2D.ICCTargetedTouchDelegate, Cocos2D.ICCStandardTouchDelegate, Cocos2D.ICCTouchDelegate, Cocos2D.ICCKeypadDelegate, Cocos2D.ICCKeyboardDelegate, Cocos2D.ICCRGBAProtocol, System.Collections.Generic.IComparer{Cocos2D.CCNode}

Constructors

CCScale9Sprite()

CCScale9Sprite()()

CCScale9Sprite(CCRect)

CCScale9Sprite(CCRect)(Cocos2D.CCRect capInsets)
Parameters:
capInsets (Cocos2D.CCRect)

CCScale9Sprite(CCSprite, CCRect, CCRect)

CCScale9Sprite(CCSprite, CCRect, CCRect)(Cocos2D.CCSprite sprite, Cocos2D.CCRect _spriteRect, Cocos2D.CCRect capInsets)
Parameters:
sprite (Cocos2D.CCSprite)
_spriteRect (Cocos2D.CCRect)
capInsets (Cocos2D.CCRect)

CCScale9Sprite(CCSpriteFrame)

CCScale9Sprite(CCSpriteFrame)(Cocos2D.CCSpriteFrame spriteFrame)
Parameters:
spriteFrame (Cocos2D.CCSpriteFrame)

CCScale9Sprite(CCSpriteFrame, CCRect)

CCScale9Sprite(CCSpriteFrame, CCRect)(Cocos2D.CCSpriteFrame spriteFrame, Cocos2D.CCRect capInsets)
Parameters:
spriteFrame (Cocos2D.CCSpriteFrame)
capInsets (Cocos2D.CCRect)

CCScale9Sprite(string)

CCScale9Sprite(string)(System.String alias)
Parameters:
alias (System.String)

CCScale9Sprite(string, CCRect)

CCScale9Sprite(string, CCRect)(System.String spriteFrameName, Cocos2D.CCRect capInsets)
Parameters:
spriteFrameName (System.String)
capInsets (Cocos2D.CCRect)

Fields

_bottom(Cocos2D.CCSprite)
_bottomLeft(Cocos2D.CCSprite)
_bottomRight(Cocos2D.CCSprite)
_capInsetsInternal(Cocos2D.CCRect)
_centre(Cocos2D.CCSprite)
_left(Cocos2D.CCSprite)
_opacity(System.Byte)
_opacityModifyRGB(System.Boolean)
_positionsAreDirty(System.Boolean)
_right(Cocos2D.CCSprite)
_scale9Image(Cocos2D.CCSpriteBatchNode)
_spriteFrameRotated(System.Boolean)
_spriteRect(Cocos2D.CCRect)
_spritesGenerated(System.Boolean)
_top(Cocos2D.CCSprite)
_topLeft(Cocos2D.CCSprite)
_topRight(Cocos2D.CCSprite)

Properties

CapInsets(Cocos2D.CCRect)
Color(Cocos2D.CCColor3B)

Gets or sets the color

ContentSize(Cocos2D.CCSize)
InsetBottom(System.Single)
InsetLeft(System.Single)
InsetRight(System.Single)
InsetTop(System.Single)
IsOpacityModifyRGB(System.Boolean)

sets the premultipliedAlphaOpacity property. If set to NO then opacity will be applied as: glColor(R,G,B,opacity); If set to YES then oapcity will be applied as: glColor(opacity, opacity, opacity, opacity ); Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO @since v0.8

Opacity(System.Byte)

Gets or sets the Opacity @warning If the the texture has premultiplied alpha then, the R, G and B channels will be modifed. Values goes from 0 to 255, where 255 means fully opaque.

PreferredSize(Cocos2D.CCSize)

Methods

Init()

System.Boolean Init()()
Returns:
System.Boolean
Example

InitWithBatchNode(CCSpriteBatchNode, CCRect, CCRect)

System.Boolean InitWithBatchNode(CCSpriteBatchNode, CCRect, CCRect)(Cocos2D.CCSpriteBatchNode batchnode, Cocos2D.CCRect rect, Cocos2D.CCRect capInsets)
Parameters:
batchnode (Cocos2D.CCSpriteBatchNode)
rect (Cocos2D.CCRect)
capInsets (Cocos2D.CCRect)
Returns:
System.Boolean

InitWithBatchNode(CCSpriteBatchNode, CCRect, bool, CCRect)

System.Boolean InitWithBatchNode(CCSpriteBatchNode, CCRect, bool, CCRect)(Cocos2D.CCSpriteBatchNode batchnode, Cocos2D.CCRect rect, System.Boolean rotated, Cocos2D.CCRect capInsets)
Parameters:
batchnode (Cocos2D.CCSpriteBatchNode)
rect (Cocos2D.CCRect)
rotated (System.Boolean)
capInsets (Cocos2D.CCRect)
Returns:
System.Boolean

InitWithSprite(CCSprite, CCRect, CCRect)

System.Boolean InitWithSprite(CCSprite, CCRect, CCRect)(Cocos2D.CCSprite sprite, Cocos2D.CCRect spriteRect, Cocos2D.CCRect capInsets)
Parameters:
sprite (Cocos2D.CCSprite)
spriteRect (Cocos2D.CCRect)
capInsets (Cocos2D.CCRect)
Returns:
System.Boolean

InitWithSpriteFrame(CCSpriteFrame)

System.Boolean InitWithSpriteFrame(CCSpriteFrame)(Cocos2D.CCSpriteFrame spriteFrame)
Parameters:
spriteFrame (Cocos2D.CCSpriteFrame)
Returns:
System.Boolean

InitWithSpriteFrame(CCSpriteFrame, CCRect)

System.Boolean InitWithSpriteFrame(CCSpriteFrame, CCRect)(Cocos2D.CCSpriteFrame spriteFrame, Cocos2D.CCRect capInsets)
Parameters:
spriteFrame (Cocos2D.CCSpriteFrame)
capInsets (Cocos2D.CCRect)
Returns:
System.Boolean

InitWithSpriteFrameName(string)

System.Boolean InitWithSpriteFrameName(string)(System.String spriteFrameName)
Parameters:
spriteFrameName (System.String)
Returns:
System.Boolean

InitWithSpriteFrameName(string, CCRect)

System.Boolean InitWithSpriteFrameName(string, CCRect)(System.String spriteFrameName, Cocos2D.CCRect capInsets)
Parameters:
spriteFrameName (System.String)
capInsets (Cocos2D.CCRect)
Returns:
System.Boolean

SetSpriteFrame(CCSpriteFrame)

SetSpriteFrame(CCSpriteFrame)(Cocos2D.CCSpriteFrame spriteFrame)
Parameters:
spriteFrame (Cocos2D.CCSpriteFrame)

UpdateCapInset()

UpdateCapInset()()

UpdateDisplayedColor(CCColor3B)

UpdateDisplayedColor(CCColor3B)(Cocos2D.CCColor3B parentColor)

recursive method that updates display color

Parameters:
parentColor (Cocos2D.CCColor3B)
Example

UpdateDisplayedOpacity(byte)

UpdateDisplayedOpacity(byte)(System.Byte parentOpacity)

recursive method that updates the displayed opacity.

Parameters:
parentOpacity (System.Byte)
Example

UpdatePositions()

UpdatePositions()()

UpdateWithBatchNode(CCSpriteBatchNode, CCRect, bool, CCRect)

System.Boolean UpdateWithBatchNode(CCSpriteBatchNode, CCRect, bool, CCRect)(Cocos2D.CCSpriteBatchNode batchnode, Cocos2D.CCRect rect, System.Boolean rotated, Cocos2D.CCRect capInsets)
Parameters:
batchnode (Cocos2D.CCSpriteBatchNode)
rect (Cocos2D.CCRect)
rotated (System.Boolean)
capInsets (Cocos2D.CCRect)
Returns:
System.Boolean

UpdateWithBatchNode(CCSpriteBatchNode, CCSize, bool, CCRect)

System.Boolean UpdateWithBatchNode(CCSpriteBatchNode, CCSize, bool, CCRect)(Cocos2D.CCSpriteBatchNode batchnode, Cocos2D.CCSize bounds, System.Boolean rotated, Cocos2D.CCRect capInsets)
Parameters:
batchnode (Cocos2D.CCSpriteBatchNode)
bounds (Cocos2D.CCSize)
rotated (System.Boolean)
capInsets (Cocos2D.CCRect)
Returns:
System.Boolean

Visit()

Visit()()

This is called with every call to the MainLoop on the CCDirector class. In XNA, this is the same as the Draw() call.

Example