A CCSpriteFrame has: More...
#include <CCSpriteFrame.h>
Public Member Functions | |
const CCRect & | getRectInPixels (void) |
void | setRectInPixels (const CCRect &rectInPixels) |
local | setRectInPixels ( local rectInPixels) |
bool | isRotated (void) |
void | setRotated (bool bRotated) |
const CCRect & | getRect (void) |
get rect of the frame More... | |
local | getRect () |
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... | |
local | getOffsetInPixels () |
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... | |
var | getOriginalSize () |
get original size of the trimmed image More... | |
local | getOriginalSize () |
get original size of the trimmed image More... | |
void | setOriginalSize (const CCSize &sizeInPixels) |
set original size of the trimmed image More... | |
local | setOriginalSize ( local sizeInPixels) |
set original size of the trimmed image More... | |
CCTexture2D * | getTexture (void) |
get texture of the frame More... | |
var | getTexture () |
get texture of the frame More... | |
local | getTexture () |
get texture of the frame More... | |
void | setTexture (CCTexture2D *pobTexture) |
set texture of the frame, the texture is retained More... | |
const CCPoint & | getOffset (void) |
local | getOffset () |
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... | |
Public Member Functions inherited from CCObject | |
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... | |
var | create ( var filename, var rect, var rotated, var offset, var originalSize) |
Create a CCSpriteFrame with a texture filename, rect, rotated, offset and originalSize in pixels. More... | |
local | create ( local filename, local rect, local rotated, local offset, local 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... | |
var | createWithTexture ( var pobTexture, var rect, var rotated, var offset, var originalSize) |
Create a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More... | |
local | createWithTexture ( local pobTexture, local rect, local rotated, local offset, local originalSize) |
Create a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More... | |
Protected Attributes | |
CCPoint | m_obOffset |
CCSize | m_obOriginalSize |
var | m_obOriginalSize |
local | m_obOriginalSize |
CCRect | m_obRectInPixels |
bool | m_bRotated |
CCRect | m_obRect |
var | m_obRect |
local | m_obRect |
CCPoint | m_obOffsetInPixels |
local | m_obOffsetInPixels |
CCSize | m_obOriginalSizeInPixels |
local | m_obOriginalSizeInPixels |
CCTexture2D * | m_pobTexture |
var | m_pobTexture |
local | m_pobTexture |
std::string | m_strTextureFilename |
var | m_strTextureFilename |
local | m_strTextureFilename |
Protected Attributes inherited from CCObject | |
unsigned int | m_uReference |
unsigned int | m_uAutoReleaseCount |
Additional Inherited Members | |
Public Attributes inherited from CCObject | |
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 in points.
It is assumed that the frame was not trimmed.
|
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 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 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 in points.
It is assumed that the frame was not 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.
|
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.
|
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 | ) |
var getOffset | ( | ) |
local getOffset | ( | ) |
const CCPoint& getOffsetInPixels | ( | void | ) |
get offset of the frame
var getOffsetInPixels | ( | ) |
get offset of the frame
local getOffsetInPixels | ( | ) |
get offset of the frame
|
inline |
get original size of the trimmed image
|
inline |
get original size of the trimmed image
|
inline |
get original size of the trimmed image
|
inline |
get original size of the trimmed image
|
inline |
get original size of the trimmed image
|
inline |
get original size of the trimmed image
|
inline |
get rect of the frame
|
inline |
get rect of the frame
|
inline |
get rect of the frame
|
inline |
|
inline |
|
inline |
CCTexture2D* getTexture | ( | void | ) |
get texture of the frame
var getTexture | ( | ) |
get texture of the frame
local getTexture | ( | ) |
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.
var initWithTexture | ( | var | pobTexture, |
var | rect | ||
) |
Initializes a CCSpriteFrame with a texture, rect in points.
It is assumed that the frame was not trimmed.
local initWithTexture | ( | local | pobTexture, |
local | 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.
var initWithTexture | ( | var | pobTexture, |
var | rect, | ||
var | rotated, | ||
var | offset, | ||
var | 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.
local initWithTexture | ( | local | pobTexture, |
local | rect, | ||
local | rotated, | ||
local | offset, | ||
local | 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.
var initWithTextureFilename | ( | var | filename, |
var | rect | ||
) |
Initializes a CCSpriteFrame with a texture filename, rect in points; It is assumed that the frame was not trimmed.
local initWithTextureFilename | ( | local | filename, |
local | 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.
var initWithTextureFilename | ( | var | filename, |
var | rect, | ||
var | rotated, | ||
var | offset, | ||
var | 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.
local initWithTextureFilename | ( | local | filename, |
local | rect, | ||
local | rotated, | ||
local | offset, | ||
local | 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 |
|
inline |
|
inline |
void setOffset | ( | const CCPoint & | offsets) |
var setOffset | ( | var | offsets) |
local setOffset | ( | local | offsets) |
void setOffsetInPixels | ( | const CCPoint & | offsetInPixels) |
set offset of the frame
var setOffsetInPixels | ( | var | offsetInPixels) |
set offset of the frame
local setOffsetInPixels | ( | local | offsetInPixels) |
set offset of the frame
|
inline |
set original size of the trimmed image
|
inline |
set original size of the trimmed image
|
inline |
set original size of the trimmed image
|
inline |
set original size of the trimmed image
|
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
var setRect | ( | var | rect) |
set rect of the frame
local setRect | ( | local | rect) |
set rect of the frame
void setRectInPixels | ( | const CCRect & | rectInPixels) |
var setRectInPixels | ( | var | rectInPixels) |
local setRectInPixels | ( | local | rectInPixels) |
|
inline |
|
inline |
|
inline |
void setTexture | ( | CCTexture2D * | pobTexture) |
set texture of the frame, the texture is retained
var setTexture | ( | var | pobTexture) |
set texture of the frame, the texture is retained
local setTexture | ( | local | pobTexture) |
set texture of the frame, the texture is retained
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |