Inherits from CCSprite : CCNodeRGBA : CCNode : NSObject
Conforms to cpCCNodeProtocol
Declared in cpCCSprite.h

Overview

A Cocos2d CCSprite that conforms to the cpCCNodeProtocol

Tasks

PhysicsEditor Methods

Class Methods

spriteWithBodyName:spaceManager:

Create a sprite with sprite frame name and body

+ (id)spriteWithBodyName:(NSString *)bodyName spaceManager:(SpaceManager *)spaceManager

Parameters

bodyName

name of the body as defined in PhysicsEditor

spaceManager

spaceManager to add the body to

spriteFrameName

name of a sprite frame

Return Value

cpCCSprite

Discussion

This function uses the same name for the sprite frame and the body shape.

You can use this if you also use TexturePacker http://www.texturepacker.com and activate “Trim sprite names”. In this case the .png ending is removed from the sprite’s name so that both the sprite and the body shape use the same name.

GCpShapeCache must be initialised before using this funciton.

Declared In

cpCCSprite+PhysicsEditor.h

spriteWithFile:bodyName:spaceManager:

Create a sprite with image file and body

+ (id)spriteWithFile:(NSString *)file bodyName:(NSString *)bodyName spaceManager:(SpaceManager *)spaceManager

Parameters

bodyName

name of the body as defined in PhysicsEditor

spaceManager

spaceManager to add the body to

fileName

name of the file to load

Return Value

cpCCSprite

Discussion

GCpShapeCache must be initialised before using this funciton.

Declared In

cpCCSprite+PhysicsEditor.h

spriteWithSpriteFrame:bodyName:spaceManager:

Create a sprite with sprite frame and body

+ (id)spriteWithSpriteFrame:(CCSpriteFrame *)spriteFrame bodyName:(NSString *)bodyName spaceManager:(SpaceManager *)spaceManager

Parameters

spriteFrame

pointer to a sprite frame

bodyName

name of the body as defined in PhysicsEditor

spaceManager

spaceManager to add the body to

Return Value

cpCCSprite

Discussion

GCpShapeCache must be initialised before using this funciton.

Declared In

cpCCSprite+PhysicsEditor.h

spriteWithSpriteFrameName:bodyName:spaceManager:

Create a sprite with sprite frame name and body

+ (id)spriteWithSpriteFrameName:(NSString *)spriteFrameName bodyName:(NSString *)bodyName spaceManager:(SpaceManager *)spaceManager

Parameters

spriteFrameName

name of a sprite frame

bodyName

name of the body as defined in PhysicsEditor

spaceManager

spaceManager to add the body to

Return Value

cpCCSprite

Discussion

GCpShapeCache must be initialised before using this funciton.

Declared In

cpCCSprite+PhysicsEditor.h

Instance Methods

initWithBodyName:spaceManager:

Create a sprite with sprite frame name and body

- (id)initWithBodyName:(NSString *)bodyName spaceManager:(SpaceManager *)spaceManager

Parameters

bodyName

name of the body as defined in PhysicsEditor

spaceManager

spaceManager to add the body to

spriteFrameName

name of a sprite frame

Return Value

cpCCSprite

Discussion

This function uses the same name for the sprite frame and the body shape.

You can use this if you also use TexturePacker http://www.texturepacker.com and activate “Trim sprite names”. In this case the .png ending is removed from the sprite’s name so that both the sprite and the body shape use the same name.

GCpShapeCache must be initialised before using this funciton.

Declared In

cpCCSprite+PhysicsEditor.h

initWithFile:bodyName:spaceManager:

Create a sprite with image file and body

- (id)initWithFile:(NSString *)fileName bodyName:(NSString *)bodyName spaceManager:(SpaceManager *)spaceManager

Parameters

fileName

name of the file to load

bodyName

name of the body as defined in PhysicsEditor

spaceManager

spaceManager to add the body to

Return Value

cpCCSprite

Discussion

GCpShapeCache must be initialised before using this funciton.

Declared In

cpCCSprite+PhysicsEditor.h

initWithSpriteFrame:bodyName:spaceManager:

Create a sprite with sprite frame and body

- (id)initWithSpriteFrame:(CCSpriteFrame *)spriteFrame bodyName:(NSString *)bodyName spaceManager:(SpaceManager *)spaceManager

Parameters

spriteFrame

pointer to a sprite frame

bodyName

name of the body as defined in PhysicsEditor

spaceManager

spaceManager to add the body to

Return Value

cpCCSprite

Discussion

GCpShapeCache must be initialised before using this funciton.

Declared In

cpCCSprite+PhysicsEditor.h

initWithSpriteFrameName:bodyName:spaceManager:

Create a sprite with sprite frame name and body

- (id)initWithSpriteFrameName:(NSString *)spriteFrameName bodyName:(NSString *)bodyName spaceManager:(SpaceManager *)spaceManager

Parameters

spriteFrameName

name of a sprite frame

bodyName

name of the body as defined in PhysicsEditor

spaceManager

spaceManager to add the body to

Return Value

cpCCSprite

Discussion

GCpShapeCache must be initialised before using this funciton.

Declared In

cpCCSprite+PhysicsEditor.h