One of cocos2d-x animations

Source: Internet
Author: User

Struct transformValues _ has the following parameters:

CCPoint pos; // position x and y
CCPoint scale; // scale x and y to zoom in and out
Float rotation; rotation
CCPoint skew; // skew x and y skew
CCPoint ap; // anchor point in pixels anchor
Bool visvisible; visible

Public Member Functions
Virtual GLubyte getOpacity (void)
GetOpacity for Transparency
Virtual void setOpacity (GLubyte var)
SetOpacity sets transparency
Virtual const ccColor3B & getColor (void)
GetColor
Virtual void setColor (const ccColor3B & var)
SetColor set color
Virtual void draw (void) painting can overwrite and convert to your own painting Method
Override this method to draw your own node.
Whether the bool isDirty (void) genie needs to be updated on its own bitmap
Whether or not the Sprite needs to be updated in the Atlas
Void setDirty (bool bDirty) set whether to update
Make the Sprite to be updated in the Atlas.
CcV3F_C4B_T2F_Quad getQuad (void) obtains the vertex position and color of the text position.
Get the quad (tex coords, vertex coords and color) information
Whether bool isTextureRectRotated (void) is rotated
Returns whether or not the texture rectangle is rotated
Unsigned int getAtlasIndex (void) to obtain the ID of the image set
Set the index used on the TextureAtlas.
Void setAtlasIndex (unsigned int uAtlasIndex): Specifies the ID of an image collection.
Set the index used on the TextureAtlas.
Const CCRect & getTextureRect (void) returns the sprite size
Returns the rect of the CCSprite in points
Bool isUsesBatchNode (void) determines whether the genie is rendered in CCSpriteBatchNode
Whether or not the Sprite is rendered using a CCSpriteBatchNode
Void setUsesSpriteBatchNode (bool bUsesSpriteBatchNode) sets the sprite object to be rendered in CCSpriteBatchNode
Make the Sprite been rendered using a CCSpriteBatchNode
CCTextureAtlas * getTextureAtlas (void) gets the set map texture
Void setTextureAtlas (CCTextureAtlas * pobTextureAtlas)
CCSpriteBatchNode * getSpriteBatchNode (void) sets and obtains a batch of genie Sets
Void setSpriteBatchNode (CCSpriteBatchNode * pobSpriteBatchNode)
Does ccHonorParentTransform getHonorParentTransform (void) change according to its parent matrix change?
Whether or not to transform according to its parent transformations.
Void setHonorParentTransform (ccHonorParentTransform eHonorParentTransform)
Whether or not to transform according to its parent transformations.
Const CCPoint & getOffsetPositionInPixels (void) get cheap location (pixel)
Get offset position of the sprite.
CcBlendFunc getBlendFunc (void)
Conforms to CCTextureProtocol protocol
Void setBlendFunc (ccBlendFunc blendFunc)
Conforms to CCTextureProtocol protocol
CCSprite (void)
Virtual ~ CCSprite (void)
Virtual bool init (void)
Virtual void removeChild (CCNode * pChild, bool bCleanup) Remove whether the child cleanup action
Removes a child from the container.
Virtual void removeAllChildrenWithCleanup (bool bCleanup)
Removes all children from the container and do a cleanup all running actions depending on the cleanup parameter.
Virtual void reorderChild (CCNode * pChild, int zOrder) is determined by zOrder.
Reorders a child according to a new z value.
Virtual void addChild (CCNode * pChild)
Adds a child to the container with z-order as 0.
Virtual void addChild (CCNode * pChild, int zOrder)
Adds a child to the container with a z-order If the child is added to a 'running' node, then 'onenter' and 'onentertransitiondidfinish 'will be called immediately.
Virtual void addChild (CCNode * pChild, int zOrder, int tag)
Adds a child to the container with z order and tag If the child is added to a 'running' node, then 'onenter' and 'onentertransitiondidfinish 'will be called immediately.
Virtual void setDirtyRecursively (bool bValue)
Virtual void setPosition (const CCPoint & pos)
SetPosition
Virtual void setPositionInPixels (const CCPoint & pos)
SetPositionInPixels
Virtual void setRotation (float fRotation) sets Rotation
SetRotation
Virtual void setSkewX (float sx) sets the skew XY
SetSkewX
Virtual void setSkewY (float sy)
SetSkewY
Virtual void setScaleX (float fScaleX)
SetScaleX
Virtual void setScaleY (float fScaleY)
SetScaleY
Virtual void setScale (float fScale)
The scale factor of the node.
Virtual void setVertexZ (float fVertexZ) sets the Z axis vertex coordinates
SetVertexZ
Virtual void setAnchorPoint (const CCPoint & anchor)
SetAnchorPoint
Virtual void setIsRelativeAnchorPoint (bool bRelative) sets whether the coordinates are relative to the anchor.
SetIsRelativeAnchorPoint
Virtual void setIsVisible (bool bVisible) sets whether it is visible
SetIsVisible
Void setFlipX (bool bFlipX) set X to flip Y to flip
Void setFlipY (bool bFlipY)
Bool isFlipX (void)
Whether or not the sprite is flipped horizontally.
Bool isFlipY (void)
Whether or not the sprite is flipped vertically.
Void updateColor (void)
Virtual void setIsOpacityModifyRGB (bool bValue) sets whether to perform RGB transparent Modification
Opacity: conforms to CCRGBAProtocol protocol
Virtual bool getIsOpacityModifyRGB (void)
Returns whether or not the opacity will be applied using glColor (R, G, B, opacity) or glColor (opacity, opacity );
Virtual void setTexture (CCTexture2D * texture) sets the texture
Virtual CCTexture2D * getTexture (void)
Bool initWithTexture (CCTexture2D * pTexture) initializes the sprite through texture
Initializes an sprite with a texture.
Bool initWithTexture (CCTexture2D * pTexture, const CCRect & rect) initializes sprite through textures and rectangles
Initializes an sprite with a texture and a rect.
Bool initWithSpriteFrame (CCSpriteFrame * pSpriteFrame)
Bool initWithSpriteFrameName (const char * pszSpriteFrameName)
Initializes an sprite with an sprite frame name.
Bool initWithFile (const char * pszFilename)
Initializes an sprite with an image filename.
Bool initWithFile (const char * pszFilename, const CCRect & rect)
Initializes an sprite with an image filename, and a rect. initialize the sprite through an image address and rectangle
Bool initWithBatchNode (CCSpriteBatchNode * batchNode, const CCRect & rect) initializes the genie through a sprite set and a rectangle
Initializes an sprite with an CCSpriteBatchNode and a rect in points.
Bool initWithBatchNodeRectInPixels (CCSpriteBatchNode * batchNode, const CCRect & rect)
Initializes an sprite with an CCSpriteBatchNode and a rect in pixels.
Void updateTransform (void) Update Matrix
Updates the quad according the rotation, position, scale values.
Void useSelfRender (void) uses its own Rendering
Tell the sprite to use self-render.
Void setTextureRect (const CCRect & rect) updates the sprite's rectangle on the texture
Updates the texture rect of the CCSprite in points.
Void setTextureRectInPixels (const CCRect & rect, bool rotated, const CCSize & size)
Updates the texture rect, rectRotated and untrimmed size of the CCSprite in pixels
Void useBatchNode (CCSpriteBatchNode * batchNode) uses the sprite set
Tell the sprite to use batch node render.
Void setDisplayFrame (CCSpriteFrame * pNewFrame) sets the display frame
Sets a new display frame to the CCSprite.
Bool isFrameDisplayed (CCSpriteFrame * pFrame) determines the current display frame
Returns whether or not a CCSpriteFrame is being displayed
CCSpriteFrame * displayedFrame (void) returns the current display frame
Returns the current displayed frame.
Void setDisplayFrameWithAnimationName (const char * animationName, int frameIndex)
Changes the display frame with animation name and index.
Static Public Member Functions
Static CCSprite * spriteWithTexture (CCTexture2D * pTexture)
Creates an sprite with a texture. Create an genie through texture
Static CCSprite * spriteWithTexture (CCTexture2D * pTexture, const CCRect & rect)
Creates an sprite with a texture and a rect. Create an genie through textures and rectangles
Static CCSprite * spriteWithTexture (CCTexture2D * pTexture, const CCRect & rect, const CCPoint & offset)
Creates an sprite with a texture, a rect and offset. Create an genie through the texture and offset rectangle
Static CCSprite * spriteWithSpriteFrame (CCSpriteFrame * pSpriteFrame)
Creates an sprite with an sprite frame. Create an genie through Frames
Static CCSprite * spriteWithSpriteFrameName (const char * pszSpriteFrameName)
Creates an sprite with an sprite frame name. Create an genie by frame name
Static CCSprite * spriteWithFile (const char * pszFileName)
Creates an sprite with an image filename. Create an genie through the image
Static CCSprite * spriteWithFile (const char * pszFileName, const CCRect & rect)
Creates an sprite with an image filename and a rect. Create an genie through images and rectangles
Static CCSprite * spriteWithBatchNode (CCSpriteBatchNode * batchNode, const CCRect & rect)
Creates an sprite with an CCBatchNode and a rect. Create an genie through the sprite set and rectangle
Protected Member Functions
Void updateTextureCoords (const CCRect & rect) updates the texture position rectangle.
Void updateBlendFunc (void) Update Hybrid Method
Void getTransformValues (struct transformValues _ * TV) to obtain matrix parameters
Protected Attributes
GLubyte m_nOpacity transparent
Opacity: conforms to CCRGBAProtocol protocol.
CcColor3B m_sColor color
Color: conforms with CCRGBAProtocol protocol.
CCTextureAtlas * m_pobTextureAtlas
Unsigned int m_uAtlasIndex gallery Index
CCSpriteBatchNode * m_pobBatchNode Genie set
Whether ccHonorParentTransform m_eHonorParentTransform is transformed with the parent Matrix
Whether bool m_bDirty is updated
Bool m_bRecursiveDirty?
Whether bool m_bHasChildren has sub-objects
CcBlendFunc m_sBlendFunc Mixed Method
CCTexture2D * m_pobTexture texture
Whether bool m_bUsesBatchNode uses the Genie set
CCRect m_obRect rectangle
CCRect m_obRectInPixels
Whether bool m_bRectRotated is rectangular Rotation
CCPoint m_obOffsetPositionInPixels offset
CCPoint m_obUnflippedOffsetPositionFromCenter
CcV3F_C4B_T2F_Quad m_sQuad QUAD
CcColor3B m_sColorUnmodified original color
Whether the bool m_bOpacityModifyRGB is transparent
Whether bool m_bFlipX is X flipped
Whether bool m_bFlipY is Y flipped

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.