CCSpriteSheet Class Reference

#import <CCSpriteSheet.h>

Inherits CCNode, and CCTextureProtocol-p.

Inherited by CCBitmapFontAtlas, and CCTMXLayer.

Collaboration diagram for CCSpriteSheet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(id) - initWithTexture:capacity:
(id) - initWithFile:capacity:
(CCSprite *) - createSpriteWithRect:
(void) - initSprite:rect:
(void) - removeChildAtIndex:cleanup:
(void) - removeChild:cleanup:

Static Public Member Functions

(id) + spriteSheetWithTexture:
(id) + spriteSheetWithTexture:capacity:
(id) + spriteSheetWithFile:
(id) + spriteSheetWithFile:capacity:

Properties

CCTextureAtlastextureAtlas
ccBlendFunc blendFunc
NSMutableArray * descendants

Detailed Description

CCSpriteSheet is the object that draws all the CCSprite objects that belongs to this object. Use 1 CCSpriteSheet per TextureAtlas

Limitations:

Since:
v0.7.1

Definition at line 35 of file CCSpriteSheet.h.


Member Function Documentation

- (CCSprite*) createSpriteWithRect:  

creates an sprite with a rect in the CCSpriteSheet. It's the same as:

  • create an standard CCSsprite
  • set the usingSpriteSheet = YES
  • set the textureAtlas to the same texture Atlas as the CCSpriteSheet
    Deprecated:
    Use [CCSprite spriteWithSpriteSheet:rect] instead;
- (void) initSprite: (CCSprite *)  sprite  

initializes a previously created sprite with a rect. This sprite will have the same texture as the CCSpriteSheet. It's the same as:

  • initialize an standard CCSsprite
  • set the usingSpriteSheet = YES
  • set the textureAtlas to the same texture Atlas as the CCSpriteSheet
    Since:
    v0.99.0
    Deprecated:
    Use [CCSprite initWithSpriteSheet:rect] instead;
- (id) initWithFile: (NSString *)  fileImage
capacity: (NSUInteger)  capacity 

initializes a CCSpriteSheet with a file image (.png, .jpeg, .pvr, etc). The file will be loaded using the TextureMgr.

- (id) initWithTexture: (CCTexture2D *)  tex
capacity: (NSUInteger)  capacity 

initializes a CCSpriteSheet with a texture2d and capacity

- (void) removeChild: (CCSprite *)  sprite
cleanup: (BOOL)  doCleanup 

removes a child given a reference. It will also cleanup the running actions depending on the cleanup parameter.

Warning:
Removing a child from a CCSpriteSheet is very slow
- (void) removeChildAtIndex: (NSUInteger)  index
cleanup: (BOOL)  doCleanup 

removes a child given a certain index. It will also cleanup the running actions depending on the cleanup parameter.

Warning:
Removing a child from a CCSpriteSheet is very slow
+ (id) spriteSheetWithFile: (NSString *)  fileImage  

creates a CCSpriteSheet with a file image (.png, .jpeg, .pvr, etc). The file will be loaded using the TextureMgr.

+ (id) spriteSheetWithFile: (NSString *)  fileImage
capacity: (NSUInteger)  capacity 

creates a CCSpriteSheet with a file image (.png, .jpeg, .pvr, etc) and capacity. The file will be loaded using the TextureMgr.

+ (id) spriteSheetWithTexture: (CCTexture2D *)  tex  

creates a CCSpriteSheet with a texture2d

+ (id) spriteSheetWithTexture: (CCTexture2D *)  tex
capacity: (NSUInteger)  capacity 

creates a CCSpriteSheet with a texture2d and capacity


Property Documentation

- (ccBlendFunc) blendFunc [read, write, assign]

conforms to CCTextureProtocol protocol

Definition at line 50 of file CCSpriteSheet.h.

- (NSMutableArray*) descendants [read, assign]

descendants (children, gran children, etc)

Definition at line 53 of file CCSpriteSheet.h.

- (CCTextureAtlas*) textureAtlas [read, write, retain]

returns the TextureAtlas that is used

Definition at line 47 of file CCSpriteSheet.h.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Properties Defines

cocos2d for iPhone 0.99.0