|
| const Rect & | getRectInPixels () const |
| |
| void | setRectInPixels (const Rect &rectInPixels) |
| |
| bool | isRotated () const |
| |
| void | setRotated (bool rotated) |
| |
| const Rect & | getRect () const |
| | get rect of the frame More...
|
| |
| void | setRect (const Rect &rect) |
| | set rect of the frame More...
|
| |
| const Vec2 & | getOffsetInPixels () const |
| | get offset of the frame More...
|
| |
| void | setOffsetInPixels (const Vec2 &offsetInPixels) |
| | set offset of the frame More...
|
| |
| const Size & | getOriginalSizeInPixels () 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 () const |
| | get original size of the trimmed image More...
|
| |
| void | setOriginalSize (const Size &sizeInPixels) |
| | set original size of the trimmed image More...
|
| |
| Texture2D * | getTexture () |
| | get texture of the frame More...
|
| |
| void | setTexture (Texture2D *pobTexture) |
| | set texture of the frame, the texture is retained More...
|
| |
| const Vec2 & | getOffset () const |
| |
| void | setOffset (const Vec2 &offsets) |
| |
| virtual SpriteFrame * | clone () const override |
| | returns a copy of the Ref More...
|
| |
| virtual | ~SpriteFrame () |
| | NA More...
|
| |
| bool | initWithTexture (Texture2D *pobTexture, const Rect &rect) |
| | Initializes a SpriteFrame with a texture, rect in points. More...
|
| |
| bool | initWithTextureFilename (const std::string &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 Vec2 &offset, const Size &originalSize) |
| | Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More...
|
| |
| bool | initWithTextureFilename (const std::string &filename, const Rect &rect, bool rotated, const Vec2 &offset, const Size &originalSize) |
| | Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More...
|
| |
| void | retain () |
| | Retains the ownership. More...
|
| |
| void | release () |
| | Releases the ownership immediately. More...
|
| |
| Ref * | autorelease () |
| | Releases the ownership sometime soon automatically. More...
|
| |
| unsigned int | getReferenceCount () const |
| | Returns the Ref's current reference count. More...
|
| |
| virtual | ~Ref () |
| | NA NA More...
|
| |
| virtual | ~Clonable () |
| | NA NA More...
|
| |
| Ref * | copy () const |
| | returns a copy of the Ref. More...
|
| |
|
| static SpriteFrame * | create (const std::string &filename, const Rect &rect) |
| | Create a SpriteFrame with a texture filename, rect in points. More...
|
| |
| static SpriteFrame * | create (const std::string &filename, const Rect &rect, bool rotated, const Vec2 &offset, const Size &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 Vec2 &offset, const Size &originalSize) |
| | Create a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. More...
|
| |
A SpriteFrame has:
- texture: A Texture2D that will be used by the Sprite
- rectangle: A rectangle of the texture
You can modify the frame of a Sprite by doing:
SpriteFrame *frame = SpriteFrame::frameWithTexture(texture, rect, offset); sprite->setDisplayFrame(frame);