cocos2d-x 3.0 |


- 类列表 - 类索引 - 类继承关系 - 类成员
全部) 类) 命名空间) 文件) 函数) 变量) 类型定义) 枚举) 枚举值) 属性) 友元) 宏定义) 组) 页)
Public 成员函数 | 静态 Public 成员函数 | Protected 属性 | 所有成员列表
SpriteFrame类 参考 Sprite Nodes
A SpriteFrame has: 更多…
#include
类 SpriteFrame 继承关系图:
## Public 成员函数 | |
virtual | ~SpriteFrame (void) |
NA NA 更多… | |
bool | initWithTexture (Texture2D pobTexture, const Rect &rect) |
Initializes a SpriteFrame with a texture, rect in points. 更多… | |
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. 更多… | |
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. 更多… | |
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. 更多… | |
const Rect & | getRectInPixels () const |
void | setRectInPixels (const Rect &rectInPixels) |
bool | isRotated (void) const |
void | setRotated (bool rotated) |
const Rect & | getRect (void) const |
get rect of the frame 更多… | |
void | setRect (const Rect &rect) |
set rect of the frame 更多… | |
const Vec2 & | getOffsetInPixels (void) const |
get offset of the frame 更多… | |
void | setOffsetInPixels (const Vec2 &offsetInPixels) |
set offset of the frame 更多… | |
const Size & | getOriginalSizeInPixels (void) const |
get original size of the trimmed image 更多… | |
void | setOriginalSizeInPixels (const Size &sizeInPixels) |
set original size of the trimmed image 更多… | |
const Size & | getOriginalSize (void) const |
get original size of the trimmed image 更多… | |
void | setOriginalSize (const Size &sizeInPixels) |
set original size of the trimmed image 更多… | |
Texture2D | getTexture (void) |
get texture of the frame 更多… | |
void | setTexture (Texture2D pobTexture) |
set texture of the frame, the texture is retained 更多… | |
const Vec2 & | getOffset (void) const |
void | setOffset (const Vec2 &offsets) |
virtual SpriteFrame | clone () const override |
返回Ref对象的一份拷贝 更多… | |
![]() | |
void | retain () |
保留所有权. 更多… | |
void | release () |
立即释放所有权. 更多… | |
Ref | autorelease () |
自动释放所有权在不久的将来. 更多… | |
unsigned int | getReferenceCount () const |
返回Ref对象当前的引用计数. 更多… | |
virtual | ~Ref () |
NA NA 更多… | |
![]() | |
virtual | ~Clonable () |
NA NA 更多… | |
CC_DEPRECATED_ATTRIBUTE Ref * | copy () const |
返回Ref对象的一份拷贝. 更多… | |
## 静态 Public 成员函数 | |
static SpriteFrame | create (const std::string &filename, const Rect &rect) |
Create a SpriteFrame with a texture filename, rect in points. 更多… | |
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. 更多… | |
static SpriteFrame | createWithTexture (Texture2D pobTexture, const Rect &rect) |
Create a SpriteFrame with a texture, rect in points. 更多… | |
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. 更多… | |
## Protected 属性 | |
Vec2 | _offset |
Size | _originalSize |
Rect | _rectInPixels |
bool | _rotated |
Rect | _rect |
Vec2 | _offsetInPixels |
Size | _originalSizeInPixels |
Texture2D * | _texture |
std::string | _textureFilename |
![]() | |
unsigned int | _referenceCount |
引用计数 更多… | |
## 额外继承的成员函数 | |
![]() | |
Ref () | |
构造函数 更多… | |
详细描述
A SpriteFrame has:
You can modify the frame of a Sprite by doing:
SpriteFrame *frame = SpriteFrame::frameWithTexture(texture, rect, offset); sprite->setDisplayFrame(frame);
构造及析构函数说明
| virtual |
NA NA
成员函数说明
| overridevirtual |
返回Ref对象的一份拷贝
实现了 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, 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, rotated, offset and originalSize in pixels.
The originalSize is the size in points of the frame before being trimmed.
const Vec2& getOffset | ( | void | ) | const |
const Vec2& getOffsetInPixels | ( | void | ) | const |
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 |
Texture2D* getTexture | ( | void | ) |
get texture of the frame
bool initWithTexture | ( | Texture2D * | pobTexture, |
const Rect & | 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 Vec2 & | 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.
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.
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.
The originalSize is the size in pixels of the frame before being trimmed.
- 自从
- v1.1
| inline |
void setOffset | ( | const Vec2 & | offsets | ) |
void setOffsetInPixels | ( | const Vec2 & | 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 Rect & | rect | ) |
set rect of the frame
void setRectInPixels | ( | const Rect & | rectInPixels | ) |
| inline |
void setTexture | ( | Texture2D * | pobTexture | ) |
set texture of the frame, the texture is retained
类成员变量说明
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
| protected |
该类的文档由以下文件生成:
- /Users/zeroyang/Documents/github/cocos2d-x/cocos/2d/CCSpriteFrame.h
- cocos2d
- SpriteFrame
- 生成于 2014年 五月 29日 星期四 09:41:50 , 为 cocos2d-x使用
1.8.6