A SpriteFrame has: More...
#include <CCSpriteFrame.h>
Public Member Functions | |
| virtual | ~SpriteFrame (void) |
| bool | initWithTexture (Texture2D *pobTexture, const Rect &rect) |
| Initializes a SpriteFrame with a texture, rect in points. More... | |
| bool | initWithTextureFilename (const char *filename, const Rect &rect) |
| Initializes a SpriteFrame with a texture filename, rect in points; It is assumed that the frame was not trimmed. More... | |
| bool | initWithTexture (Texture2D *pobTexture, const Rect &rect, bool rotated, const Point &offset, const Size &originalSize) |
| Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More... | |
| local | initWithTexture ( local pobTexture, local rect, local rotated, local offset, local originalSize) |
| Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More... | |
| bool | initWithTextureFilename (const char *filename, const Rect &rect, bool rotated, const Point &offset, const Size &originalSize) |
| Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More... | |
| local | initWithTextureFilename ( local filename, local rect, local rotated, local offset, local originalSize) |
| Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More... | |
| const Rect & | getRectInPixels () const |
| void | setRectInPixels (const Rect &rectInPixels) |
| bool | isRotated (void) const |
| void | setRotated (bool bRotated) |
| const Rect & | getRect (void) const |
| get rect of the frame More... | |
| local | getRect () |
| get rect of the frame More... | |
| void | setRect (const Rect &rect) |
| set rect of the frame More... | |
| const Point & | getOffsetInPixels (void) const |
| get offset of the frame More... | |
| local | getOffsetInPixels () |
| get offset of the frame More... | |
| void | setOffsetInPixels (const Point &offsetInPixels) |
| set offset of the frame More... | |
| const Size & | getOriginalSizeInPixels (void) const |
| get original size of the trimmed image More... | |
| void | setOriginalSizeInPixels (const Size &sizeInPixels) |
| set original size of the trimmed image More... | |
| const Size & | getOriginalSize (void) const |
| 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 Size &sizeInPixels) |
| set original size of the trimmed image More... | |
| Texture2D * | getTexture (void) |
| get texture of the frame More... | |
| void | setTexture (Texture2D *pobTexture) |
| set texture of the frame, the texture is retained More... | |
| const Point & | getOffset (void) const |
| local | getOffset () |
| void | setOffset (const Point &offsets) |
| virtual SpriteFrame * | clone () const override |
| returns a copy of the object More... | |
Public Member Functions inherited from Object | |
| Object () | |
| Constructor. More... | |
| virtual | ~Object () |
| void | release () |
| Release the ownership immediately. More... | |
| void | retain () |
| Retains the ownership. More... | |
| Object * | autorelease () |
| Release the ownership sometime soon automatically. More... | |
| bool | isSingleReference () const |
| Returns a boolean value that indicates whether there is only one reference to the object. More... | |
| unsigned int | retainCount () const |
| Returns the object's current reference count. More... | |
| virtual bool | isEqual (const Object *object) |
| Returns a boolean value that indicates whether this object and a given object are equal. More... | |
| virtual void | acceptVisitor (DataVisitor &visitor) |
| virtual void | update (float dt) |
Public Member Functions inherited from Clonable | |
| virtual | ~Clonable () |
| CC_DEPRECATED_ATTRIBUTE Object * | copy () const |
| returns a copy of the object. More... | |
| local | copy () |
| returns a copy of the object. More... | |
Static Public Member Functions | |
| static SpriteFrame * | create (const char *filename, const Rect &rect) |
| Create a SpriteFrame with a texture filename, rect in points. More... | |
| local | create ( local filename, local rect) |
| Create a SpriteFrame with a texture filename, rect in points. More... | |
| static SpriteFrame * | create (const char *filename, const Rect &rect, bool rotated, const Point &offset, const Size &originalSize) |
| Create a SpriteFrame 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 SpriteFrame 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 SpriteFrame with a texture filename, rect, rotated, offset and originalSize in pixels. More... | |
| static SpriteFrame * | createWithTexture (Texture2D *pobTexture, const Rect &rect) |
| Create a SpriteFrame with a texture, rect in points. More... | |
| static SpriteFrame * | createWithTexture (Texture2D *pobTexture, const Rect &rect, bool rotated, const Point &offset, const Size &originalSize) |
| Create a SpriteFrame 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 SpriteFrame 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 SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More... | |
Protected Attributes | |
| Point | _offset |
| Size | _originalSize |
| var | _originalSize |
| local | _originalSize |
| Rect | _rectInPixels |
| var | _rectInPixels |
| local | _rectInPixels |
| bool | _rotated |
| Rect | _rect |
| var | _rect |
| local | _rect |
| Point | _offsetInPixels |
| var | _offsetInPixels |
| local | _offsetInPixels |
| Size | _originalSizeInPixels |
| var | _originalSizeInPixels |
| local | _originalSizeInPixels |
| Texture2D * | _texture |
| std::string | _textureFilename |
| var | _textureFilename |
| local | _textureFilename |
Protected Attributes inherited from Object | |
| unsigned int | _reference |
| count of references More... | |
| var | _reference |
| count of references More... | |
| local | _reference |
| count of references More... | |
| unsigned int | _autoReleaseCount |
| count of autorelease More... | |
| var | _autoReleaseCount |
| count of autorelease More... | |
| local | _autoReleaseCount |
| count of autorelease More... | |
Additional Inherited Members | |
Public Attributes inherited from Object | |
| unsigned int | _ID |
| object id, ScriptSupport need public _ID More... | |
| int | _luaID |
| Lua reference id. More... | |
A SpriteFrame has:
You can modify the frame of a Sprite by doing:
SpriteFrame *frame = SpriteFrame::frameWithTexture(texture, rect, offset); sprite->setDisplayFrame(frame);
|
virtual |
|
overridevirtual |
returns a copy of the object
Implements Clonable.
|
overridevirtual |
returns a copy of the object
Implements Clonable.
|
overridevirtual |
returns a copy of the object
Implements Clonable.
|
static |
Create a SpriteFrame with a texture filename, rect in points.
It is assumed that the frame was not trimmed.
|
static |
Create a SpriteFrame with a texture filename, rect in points.
It is assumed that the frame was not trimmed.
|
static |
Create a SpriteFrame with a texture filename, rect in points.
It is assumed that the frame was not trimmed.
|
static |
Create a SpriteFrame 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 SpriteFrame 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 SpriteFrame 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 SpriteFrame with a texture, rect in points.
It is assumed that the frame was not trimmed.
|
static |
Create a SpriteFrame with a texture, rect in points.
It is assumed that the frame was not trimmed.
|
static |
Create a SpriteFrame with a texture, rect in points.
It is assumed that the frame was not trimmed.
|
static |
Create a SpriteFrame 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 SpriteFrame 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 SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels.
The originalSize is the size in points of the frame before being trimmed.
| const Point& getOffset | ( | void | ) | const |
| var getOffset | ( | ) |
| local getOffset | ( | ) |
| const Point& getOffsetInPixels | ( | void | ) | const |
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 |
| Texture2D* getTexture | ( | void | ) |
get texture of the frame
| var getTexture | ( | ) |
get texture of the frame
| local getTexture | ( | ) |
get texture of the frame
Initializes a SpriteFrame with a texture, rect in points.
It is assumed that the frame was not trimmed.
| var initWithTexture | ( | var | pobTexture, |
| var | rect | ||
| ) |
Initializes a SpriteFrame with a texture, rect in points.
It is assumed that the frame was not trimmed.
| local initWithTexture | ( | local | pobTexture, |
| local | rect | ||
| ) |
Initializes a SpriteFrame with a texture, rect in points.
It is assumed that the frame was not trimmed.
| bool initWithTexture | ( | Texture2D * | pobTexture, |
| const Rect & | rect, | ||
| bool | rotated, | ||
| const Point & | offset, | ||
| const Size & | originalSize | ||
| ) |
Initializes a SpriteFrame 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 SpriteFrame 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 SpriteFrame 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 Rect & | rect | ||
| ) |
Initializes a SpriteFrame with a texture filename, rect in points; It is assumed that the frame was not trimmed.
| var initWithTextureFilename | ( | var | filename, |
| var | rect | ||
| ) |
Initializes a SpriteFrame with a texture filename, rect in points; It is assumed that the frame was not trimmed.
| local initWithTextureFilename | ( | local | filename, |
| local | rect | ||
| ) |
Initializes a SpriteFrame with a texture filename, rect in points; It is assumed that the frame was not trimmed.
| bool initWithTextureFilename | ( | const char * | filename, |
| const Rect & | rect, | ||
| bool | rotated, | ||
| const Point & | offset, | ||
| const Size & | originalSize | ||
| ) |
Initializes a SpriteFrame 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 SpriteFrame 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 SpriteFrame 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 Point & | offsets) |
| var setOffset | ( | var | offsets) |
| local setOffset | ( | local | offsets) |
| void setOffsetInPixels | ( | const Point & | 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 Rect & | 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 Rect & | rectInPixels) |
| var setRectInPixels | ( | var | rectInPixels) |
| local setRectInPixels | ( | local | rectInPixels) |
|
inline |
|
inline |
|
inline |
| void setTexture | ( | Texture2D * | 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 |