Public Member Functions | Static Public Member Functions | Properties

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


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


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

cocos2d for iPhone 0.99.4 API Reference - Generated using Doxygen 1.7.1