CCSprite
CCSprite
Cocos2DInheritance: 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}, Cocos2D.ICCTextureProtocol, Cocos2D.ICCBlendProtocol
Constructors
CCSprite()
CCSprite()()
CCSprite(CCRect)
CCSprite(CCRect)(Cocos2D.CCRect rect)
Parameters:
rect
(Cocos2D.CCRect)CCSprite(CCSize)
CCSprite(CCSize)(Cocos2D.CCSize size)
Parameters:
size
(Cocos2D.CCSize)CCSprite(CCSpriteFrame)
CCSprite(CCSpriteFrame)(Cocos2D.CCSpriteFrame pSpriteFrame)
Parameters:
pSpriteFrame
(Cocos2D.CCSpriteFrame)CCSprite(CCTexture2D)
CCSprite(CCTexture2D)(Cocos2D.CCTexture2D texture)
Parameters:
texture
(Cocos2D.CCTexture2D)CCSprite(CCTexture2D, CCRect)
CCSprite(CCTexture2D, CCRect)(Cocos2D.CCTexture2D texture, Cocos2D.CCRect rect)
Parameters:
texture
(Cocos2D.CCTexture2D)rect
(Cocos2D.CCRect)CCSprite(string)
CCSprite(string)(System.String fileName)
Parameters:
fileName
(System.String)CCSprite(string, CCRect)
CCSprite(string, CCRect)(System.String fileName, Cocos2D.CCRect rect)
Parameters:
fileName
(System.String)rect
(Cocos2D.CCRect)Fields
Properties
returns the Anchor Point of the node as a value [0,1], where 1 is 100% of the dimension and 0 is 0%.
gets or sets the source blending function for the texture
Gets or sets the color
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
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.
Sets and gets the position of the node. For Menus, this is the center of the menu. For layers, this is the lower left corner of the layer.
Rotation of the sprite, about the Z axis, in Degrees.
Rotation of the sprite, about the X axis, in Degrees.
Rotation of the sprite, about the Y axis, in Degrees.
The general scale that applies to both X and Y directions.
Scale of the node in the X direction (left to right)
Scale of the node in the Y direction (top to bottom)
gets or sets a new texture. it will be retained
This returns true if the node is visible and the parent is visible. Otherwise, it returns false.
Methods
AddChild(CCNode, int, int)
AddChild(CCNode, int, int)(Cocos2D.CCNode child, System.Int32 zOrder, System.Int32 tag)
Parameters:
child
(Cocos2D.CCNode)zOrder
(System.Int32)tag
(System.Int32)Example
Deserialize(Stream)
Deserialize(Stream)(System.IO.Stream stream)
Tells the screen to deserialize its state from the given stream.
Parameters:
stream
(System.IO.Stream)Example
Draw()
Draw()()
This is called from the Visit() method. This is where you DRAW your node. Only draw stuff from this method call.
Example
Init()
System.Boolean Init()()
Returns:
System.Boolean
Example
InitWithFile(string)
System.Boolean InitWithFile(string)(System.String fileName)
Parameters:
fileName
(System.String)Returns:
System.Boolean
InitWithFile(string, CCRect)
System.Boolean InitWithFile(string, CCRect)(System.String fileName, Cocos2D.CCRect rect)
Parameters:
fileName
(System.String)rect
(Cocos2D.CCRect)Returns:
System.Boolean
InitWithSpriteFrame(CCSpriteFrame)
System.Boolean InitWithSpriteFrame(CCSpriteFrame)(Cocos2D.CCSpriteFrame pSpriteFrame)
Parameters:
pSpriteFrame
(Cocos2D.CCSpriteFrame)Returns:
System.Boolean
InitWithTexture(CCTexture2D)
System.Boolean InitWithTexture(CCTexture2D)(Cocos2D.CCTexture2D texture)
Parameters:
texture
(Cocos2D.CCTexture2D)Returns:
System.Boolean
InitWithTexture(CCTexture2D, CCRect)
System.Boolean InitWithTexture(CCTexture2D, CCRect)(Cocos2D.CCTexture2D texture, Cocos2D.CCRect rect)
Parameters:
texture
(Cocos2D.CCTexture2D)rect
(Cocos2D.CCRect)Returns:
System.Boolean
InitWithTexture(CCTexture2D, CCRect, bool)
System.Boolean InitWithTexture(CCTexture2D, CCRect, bool)(Cocos2D.CCTexture2D pTexture, Cocos2D.CCRect rect, System.Boolean rotated)
Parameters:
pTexture
(Cocos2D.CCTexture2D)rect
(Cocos2D.CCRect)rotated
(System.Boolean)Returns:
System.Boolean
IsSpriteFrameDisplayed(CCSpriteFrame)
System.Boolean IsSpriteFrameDisplayed(CCSpriteFrame)(Cocos2D.CCSpriteFrame frame)
Parameters:
frame
(Cocos2D.CCSpriteFrame)Returns:
System.Boolean
OnExit()
OnExit()()
Example
RemoveAllChildren(bool)
RemoveAllChildren(bool)(System.Boolean cleanup)
Parameters:
cleanup
(System.Boolean)Example
RemoveChild(CCNode, bool)
RemoveChild(CCNode, bool)(Cocos2D.CCNode child, System.Boolean cleanup)
Parameters:
child
(Cocos2D.CCNode)cleanup
(System.Boolean)Example
ReorderChild(CCNode, int)
ReorderChild(CCNode, int)(Cocos2D.CCNode child, System.Int32 zOrder)
Parameters:
child
(Cocos2D.CCNode)zOrder
(System.Int32)Example
ScaleTo(CCSize)
ScaleTo(CCSize)(Cocos2D.CCSize size)
Scales the sprite to have the given size.
Parameters:
size
(Cocos2D.CCSize)Example
Serialize(Stream)
Serialize(Stream)(System.IO.Stream stream)
Tells the screen to serialize its state into the given stream.
Parameters:
stream
(System.IO.Stream)Example
SetDirtyRecursively(bool)
SetDirtyRecursively(bool)(System.Boolean bValue)
Parameters:
bValue
(System.Boolean)SetDisplayFrameWithAnimationName(string, int)
SetDisplayFrameWithAnimationName(string, int)(System.String animationName, System.Int32 frameIndex)
Parameters:
animationName
(System.String)frameIndex
(System.Int32)SetPosition(float, float)
SetPosition(float, float)(System.Single x, System.Single y)
Parameters:
x
(System.Single)y
(System.Single)Example
SetReorderChildDirtyRecursively()
SetReorderChildDirtyRecursively()()
SetTextureRect(CCRect)
SetTextureRect(CCRect)(Cocos2D.CCRect rect)
Parameters:
rect
(Cocos2D.CCRect)SetTextureRect(CCRect, bool, CCSize)
SetTextureRect(CCRect, bool, CCSize)(Cocos2D.CCRect value, System.Boolean rotated, Cocos2D.CCSize untrimmedSize)
Parameters:
value
(Cocos2D.CCRect)rotated
(System.Boolean)untrimmedSize
(Cocos2D.CCSize)SetVertexRect(CCRect)
SetVertexRect(CCRect)(Cocos2D.CCRect rect)
Parameters:
rect
(Cocos2D.CCRect)SortAllChildren()
SortAllChildren()()
Example
UpdateBlendFunc()
UpdateBlendFunc()()
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
UpdateTransform()
UpdateTransform()()
Example
VisitRenderer(ref CCAffineTransform)
VisitRenderer(ref CCAffineTransform)(Cocos2D.CCAffineTransform worldTransform)
Parameters:
worldTransform
(Cocos2D.CCAffineTransform)Example