cocos2d-iphone  2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
CCPhysicsSprite Class Reference

#import <CCPhysicsSprite.h>

Inheritance diagram for CCPhysicsSprite:
Collaboration diagram for CCPhysicsSprite:

Protected Attributes

BOOL _ignoreBodyRotation
 
 Protected Attributes inherited from CCSprite
CCTextureAtlastextureAtlas_
 
NSUInteger atlasIndex_
 
CCSpriteBatchNodebatchNode_
 
CGAffineTransform transformToBatch_
 
BOOL dirty_
 
BOOL recursiveDirty_
 
BOOL hasChildren_
 
BOOL shouldBeHidden_
 
ccBlendFunc blendFunc_
 
CCTexture2Dtexture_
 
CGRect rect_
 
BOOL rectRotated_
 
CGPoint offsetPosition_
 
CGPoint unflippedOffsetPositionFromCenter_
 
ccV3F_C4B_T2F_Quad quad_
 
GLubyte opacity_
 
ccColor3B color_
 
ccColor3B colorUnmodified_
 
BOOL opacityModifyRGB_
 
BOOL flipX_
 
BOOL flipY_
 
 Protected Attributes inherited from CCNode
float rotationX_
 
float rotationY_
 
float scaleX_
 
float scaleY_
 
float vertexZ_
 
CGPoint position_
 
float skewX_
 
float skewY_
 
CGPoint anchorPointInPoints_
 
CGPoint anchorPoint_
 
CGSize contentSize_
 
CGAffineTransform transform_
 
CGAffineTransform inverse_
 
CCCameracamera_
 
CCGridBasegrid_
 
NSInteger zOrder_
 
CCArraychildren_
 
CCNodeparent_
 
NSInteger tag_
 
void * userData_
 
id userObject_
 
CCGLProgramshaderProgram_
 
ccGLServerState glServerState_
 
NSUInteger orderOfArrival_
 
CCSchedulerscheduler_
 
CCActionManageractionManager_
 
BOOL isRunning_
 
BOOL isTransformDirty_
 
BOOL isInverseDirty_
 
BOOL visible_
 
BOOL ignoreAnchorPointForPosition_
 
BOOL isReorderChildDirty_
 

Properties

BOOL ignoreBodyRotation
 
 Properties inherited from CCSprite
BOOL dirty
 
ccV3F_C4B_T2F_Quad quad
 
NSUInteger atlasIndex
 
CGRect textureRect
 
BOOL textureRectRotated
 
BOOL flipX
 
BOOL flipY
 
GLubyte opacity
 
ccColor3B color
 
CCTextureAtlastextureAtlas
 
CCSpriteBatchNodebatchNode
 
CGPoint offsetPosition
 
ccBlendFunc blendFunc
 
 Properties inherited from CCNode
NSInteger zOrder
 
float vertexZ
 
float skewX
 
float skewY
 
float rotation
 
float rotationX
 
float rotationY
 
float scale
 
float scaleX
 
float scaleY
 
CGPoint position
 
CCCameracamera
 
CCArraychildren
 
CCGridBasegrid
 
BOOL visible
 
CGPoint anchorPoint
 
CGPoint anchorPointInPoints
 
CGSize contentSize
 
BOOL isRunning
 
CCNodeparent
 
BOOL ignoreAnchorPointForPosition
 
NSInteger tag
 
void * userData
 
id userObject
 
CCGLProgramshaderProgram
 
NSUInteger orderOfArrival
 
ccGLServerState glServerState
 
CCActionManageractionManager
 
CCSchedulerscheduler
 

Additional Inherited Members

 Instance Methods inherited from CCSprite
(id) - initWithTexture:
 
(id) - initWithTexture:rect:
 
(id) - initWithTexture:rect:rotated:
 
(id) - initWithSpriteFrame:
 
(id) - initWithSpriteFrameName:
 
(id) - initWithFile:
 
(id) - initWithFile:rect:
 
(id) - initWithCGImage:key:
 
(void) - updateTransform
 
(void) - setTextureRect:
 
(void) - setTextureRect:rotated:untrimmedSize:
 
(void) - setVertexRect:
 
(void) - setDisplayFrame:
 
(BOOL) - isFrameDisplayed:
 
(CCSpriteFrame *) - displayFrame
 
(void) - setDisplayFrameWithAnimationName:index:
 
(id) - initWithBatchNode:rect:
 
(CCSpriteFrame *) - DEPRECATED_ATTRIBUTE
 
 Class Methods inherited from CCSprite
(id) + spriteWithTexture:
 
(id) + spriteWithTexture:rect:
 
(id) + spriteWithSpriteFrame:
 
(id) + spriteWithSpriteFrameName:
 
(id) + spriteWithFile:
 
(id) + spriteWithFile:rect:
 
(id) + spriteWithCGImage:key:
 
(id) + spriteWithBatchNode:rect:
 

Detailed Description

A CCSprite subclass that is bound to a physics body. It works with:

  • Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined
  • Objective-Chipmunk: Preprocessor macro CC_ENABLE_CHIPMUNK_INTEGRATION should be defined
  • Box2d: Preprocessor macro CC_ENABLE_BOX2D_INTEGRATION should be defined

Features and Limitations:

  • Scale and Skew properties are ignored.
  • Position and rotation are going to updated from the physics body
  • If you update the rotation or position manually, the physics body will be updated
  • You can't eble both Chipmunk support and Box2d support at the same time. Only one can be enabled at compile time

Property Documentation

- (BOOL) ignoreBodyRotation
readwritenonatomicassign

Keep the sprite's rotation separate from the body.


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