A CCSpriteFrame has: More...
#include <CCSpriteFrame.h>
Public Member Functions | |
const CCRect & | getRectInPixels (void) |
void | setRectInPixels (const CCRect &rectInPixels) |
bool | isRotated (void) |
void | setRotated (bool bRotated) |
const CCRect & | getRect (void) |
get rect of the frame More... | |
void | setRect (const CCRect &rect) |
set rect of the frame More... | |
const CCPoint & | getOffsetInPixels (void) |
get offset of the frame More... | |
void | setOffsetInPixels (const CCPoint &offsetInPixels) |
set offset of the frame More... | |
const CCSize & | getOriginalSizeInPixels (void) |
get original size of the trimmed image More... | |
void | setOriginalSizeInPixels (const CCSize &sizeInPixels) |
set original size of the trimmed image More... | |
const CCSize & | getOriginalSize (void) |
get original size of the trimmed image More... | |
void | setOriginalSize (const CCSize &sizeInPixels) |
set original size of the trimmed image More... | |
CCTexture2D * | getTexture (void) |
get texture of the frame More... | |
void | setTexture (CCTexture2D *pobTexture) |
set texture of the frame, the texture is retained More... | |
const CCPoint & | getOffset (void) |
void | setOffset (const CCPoint &offsets) |
~CCSpriteFrame (void) | |
virtual CCObject * | copyWithZone (CCZone *pZone) |
bool | initWithTexture (CCTexture2D *pobTexture, const CCRect &rect) |
Initializes a CCSpriteFrame with a texture, rect in points. More... | |
bool | initWithTextureFilename (const char *filename, const CCRect &rect) |
Initializes a CCSpriteFrame with a texture filename, rect in points; It is assumed that the frame was not trimmed. More... | |
bool | initWithTexture (CCTexture2D *pobTexture, const CCRect &rect, bool rotated, const CCPoint &offset, const CCSize &originalSize) |
Initializes a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More... | |
bool | initWithTextureFilename (const char *filename, const CCRect &rect, bool rotated, const CCPoint &offset, const CCSize &originalSize) |
Initializes a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More... | |
![]() | |
CCObject (void) | |
virtual | ~CCObject (void) |
void | release (void) |
void | retain (void) |
CCObject * | autorelease (void) |
CCObject * | copy (void) |
bool | isSingleReference (void) const |
unsigned int | retainCount (void) const |
virtual bool | isEqual (const CCObject *pObject) |
virtual void | acceptVisitor (CCDataVisitor &visitor) |
virtual void | update (float dt) |
Static Public Member Functions | |
static CCSpriteFrame * | create (const char *filename, const CCRect &rect) |
Create a CCSpriteFrame with a texture filename, rect in points. More... | |
static CCSpriteFrame * | create (const char *filename, const CCRect &rect, bool rotated, const CCPoint &offset, const CCSize &originalSize) |
Create a CCSpriteFrame with a texture filename, rect, rotated, offset and originalSize in pixels. More... | |
static CCSpriteFrame * | createWithTexture (CCTexture2D *pobTexture, const CCRect &rect) |
Create a CCSpriteFrame with a texture, rect in points. More... | |
static CCSpriteFrame * | createWithTexture (CCTexture2D *pobTexture, const CCRect &rect, bool rotated, const CCPoint &offset, const CCSize &originalSize) |
Create a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More... | |
Protected Attributes | |
CCPoint | m_obOffset |
CCSize | m_obOriginalSize |
CCRect | m_obRectInPixels |
bool | m_bRotated |
CCRect | m_obRect |
CCPoint | m_obOffsetInPixels |
CCSize | m_obOriginalSizeInPixels |
CCTexture2D * | m_pobTexture |
std::string | m_strTextureFilename |
![]() | |
unsigned int | m_uReference |
unsigned int | m_uAutoReleaseCount |
Additional Inherited Members | |
![]() | |
unsigned int | m_uID |
int | m_nLuaID |
A CCSpriteFrame has:
You can modify the frame of a CCSprite by doing:
CCSpriteFrame *frame = CCSpriteFrame::frameWithTexture(texture, rect, offset); sprite->setDisplayFrame(frame);
~CCSpriteFrame | ( | void | ) |
|
static |
Create a CCSpriteFrame with a texture filename, rect in points.
It is assumed that the frame was not trimmed.
|
static |
Create a CCSpriteFrame with a texture filename, rect, rotated, offset and originalSize in pixels.
The originalSize is the size in pixels of the frame before being trimmed.
|
static |
Create a CCSpriteFrame with a texture, rect in points.
It is assumed that the frame was not trimmed.
|
static |
Create a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels.
The originalSize is the size in points of the frame before being trimmed.
const CCPoint& getOffset | ( | void | ) |
const CCPoint& getOffsetInPixels | ( | void | ) |
get offset of the frame
|
inline |
get original size of the trimmed image
|
inline |
get original size of the trimmed image
|
inline |
get rect of the frame
|
inline |
CCTexture2D* getTexture | ( | void | ) |
get texture of the frame
bool initWithTexture | ( | CCTexture2D * | pobTexture, |
const CCRect & | rect | ||
) |
Initializes a CCSpriteFrame with a texture, rect in points.
It is assumed that the frame was not trimmed.
bool initWithTexture | ( | CCTexture2D * | pobTexture, |
const CCRect & | rect, | ||
bool | rotated, | ||
const CCPoint & | offset, | ||
const CCSize & | originalSize | ||
) |
Initializes a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels.
The originalSize is the size in points of the frame before being trimmed.
bool initWithTextureFilename | ( | const char * | filename, |
const CCRect & | rect | ||
) |
Initializes a CCSpriteFrame with a texture filename, rect in points; It is assumed that the frame was not trimmed.
bool initWithTextureFilename | ( | const char * | filename, |
const CCRect & | rect, | ||
bool | rotated, | ||
const CCPoint & | offset, | ||
const CCSize & | originalSize | ||
) |
Initializes a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels.
The originalSize is the size in pixels of the frame before being trimmed.
|
inline |
void setOffset | ( | const CCPoint & | offsets) |
void setOffsetInPixels | ( | const CCPoint & | offsetInPixels) |
set offset of the frame
|
inline |
set original size of the trimmed image
|
inline |
set original size of the trimmed image
void setRect | ( | const CCRect & | rect) |
set rect of the frame
void setRectInPixels | ( | const CCRect & | rectInPixels) |
|
inline |
void setTexture | ( | CCTexture2D * | pobTexture) |
set texture of the frame, the texture is retained
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |