#import <CCSpriteFrame.h>
Public Member Functions | |
| (id) | - initWithTexture:rect:offset: |
| (id) | - initWithTexture:rect:offset:originalSize: |
Static Public Member Functions | |
| (id) | + frameWithTexture:rect:offset: |
| (id) | + frameWithTexture:rect:offset:originalSize: |
Properties | |
| CGRect | rect |
| CGPoint | offset |
| CGSize | originalSize |
| CCTexture2D * | texture |
A CCSpriteFrame has:
You can modify the frame of a CCSprite by doing:
CCSpriteFrame *frame = [CCSpriteFrame frameWithTexture:texture rect:rect offset:offset]; [sprite setDisplayFrame:frame];
Definition at line 43 of file CCSpriteFrame.h.
| + (id) frameWithTexture: | (CCTexture2D *) | texture | ||
| rect: | (CGRect) | rect | ||
| offset: | (CGPoint) | offset | ||
Create a CCSpriteFrame with a texture, rect and offset. It is assumed that the frame was not trimmed.
| + (id) frameWithTexture: | (CCTexture2D *) | texture | ||
| rect: | (CGRect) | rect | ||
| offset: | (CGPoint) | offset | ||
| originalSize: | (CGSize) | originalSize | ||
Create a CCSpriteFrame with a texture, rect, offset and originalSize. The originalSize is the size in pixels of the frame before being trimmed.
| - (id) initWithTexture: | (CCTexture2D *) | texture | ||
| rect: | (CGRect) | rect | ||
| offset: | (CGPoint) | offset | ||
Initializes a CCSpriteFrame with a texture, rect and offset. It is assumed that the frame was not trimmed.
| - (id) initWithTexture: | (CCTexture2D *) | texture | ||
| rect: | (CGRect) | rect | ||
| offset: | (CGPoint) | offset | ||
| originalSize: | (CGSize) | originalSize | ||
Initializes a CCSpriteFrame with a texture, rect, offset and originalSize. The originalSize is the size in pixels of the frame before being trimmed.
- (CGPoint) offset [read, write, assign] |
offset of the frame
Definition at line 55 of file CCSpriteFrame.h.
- (CGSize) originalSize [read, write, assign] |
original size of the trimmed image
Definition at line 58 of file CCSpriteFrame.h.
- (CGRect) rect [read, write, assign] |
rect of the frame
Definition at line 52 of file CCSpriteFrame.h.
- (CCTexture2D*) texture [read, write, retain] |
texture of the frame
Definition at line 61 of file CCSpriteFrame.h.