#import <Sprite.h>
Inherits TextureNode, and CocosNodeFrames-p.
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 |
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:
| - (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
| + (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
- (BOOL) autoCenterFrames [read, write, assign] |
whether or not the new frames will be auto centered
1.5.8