Sprite Class Reference

#import <Sprite.h>

Inherits TextureNode, and CocosNodeFrames-p.

Collaboration diagram for Sprite:

Collaboration graph
[legend]

List of all members.

Public Member Functions

(id) - initWithFile:
(id) - initWithPVRTCFile:bpp:hasAlpha:width:
(id) - initWithCGImage:
(id) - initWithTexture:

Static Public Member Functions

(id) + spriteWithFile:
(id) + spriteWithPVRTCFile:bpp:hasAlpha:width:
(id) + spriteWithCGImage:
(id) + spriteWithTexture:

Properties

BOOL autoCenterFrames


Detailed Description

Sprite is a subclass of TextureNode that implements the CocosNodeFrames protocol.

Sprite supports ALL CocosNode transformations, but in contrast to AtlasSprite it is much slower. ONLY use Sprite if you can't achieve the same with effect with AtlasSprite, otherwise the use of AtlasSprite is recommended.

All features from TextureNode are valid, plus the following new features:

Limitations of Sprite:


Member Function Documentation

- (id) initWithCGImage: (CGImageRef)  image  

creates an sprite from a CGImageRef image

- (id) initWithFile: (NSString *)  imageFile  

initializes the sprite with an image file

- (id) initWithPVRTCFile: (NSString *)  fileimage
bpp: (int)  bpp
hasAlpha: (BOOL)  alpha 

creates an sprite with a PVRTC image file It can only load square images: width == height, and it must be a power of 2 (128,256,512...) bpp can only be 2 or 4. 2 means more compression but lower quality. hasAlpha: whether or not the image contains alpha channel

Deprecated:
This method will be removed in v0.8. Use initWithFile instead. It supports PVRTC (non Raw) format

- (id) initWithTexture: (Texture2D *)  tex  

initializes the sprite with a Texture2D instance

+ (id) spriteWithCGImage: (CGImageRef)  image  

creates an sprite from a CGImageRef image

+ (id) spriteWithFile: (NSString *)  imageFile  

creates an sprite with an image file

+ (id) spriteWithPVRTCFile: (NSString *)  fileimage
bpp: (int)  bpp
hasAlpha: (BOOL)  alpha 

creates an sprite with a PVRTC image file It can only load square images: width == height, and it must be a power of 2 (128,256,512...) bpp can only be 2 or 4. 2 means more compression but lower quality. hasAlpha: whether or not the image contains alpha channel

Deprecated:
This method will be removed in v0.8. Use spriteWithFile instead. It supports PVRTC (non Raw) format

+ (id) spriteWithTexture: (Texture2D *)  tex  

creates an sprite with a Texture2D instance


Property Documentation

- (BOOL) autoCenterFrames [read, write, assign]

whether or not the new frames will be auto centered


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

Generated on Tue Jun 9 10:39:45 2009 for cocos2d for iPhone 0.7.3 by  doxygen 1.5.8