CCSpriteFrame Class Reference

#import <CCSpriteFrame.h>

Collaboration diagram for CCSpriteFrame:
Collaboration graph
[legend]

List of all members.

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
CCTexture2Dtexture

Detailed Description

A CCSpriteFrame is an NSObject that encapsulates a CGRect. And a CGRect represents a frame within the CCSpriteSheet

Definition at line 25 of file CCSpriteFrame.h.


Member Function Documentation

+ (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.


Property Documentation

- (CGPoint) offset [read, write, assign]

offset of the frame

Definition at line 37 of file CCSpriteFrame.h.

- (CGSize) originalSize [read, write, assign]

original size of the trimmed image

Definition at line 40 of file CCSpriteFrame.h.

- (CGRect) rect [read, write, assign]

rect of the frame

Definition at line 34 of file CCSpriteFrame.h.

- (CCTexture2D*) texture [read, write, retain]

texture of the frame

Definition at line 43 of file CCSpriteFrame.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