Cocos2d-x中,Speed类的使用
来源:互联网 发布:vb datagrid 列不显示 编辑:程序博客网 时间:2024/05/17 01:06
跟Follow类一样,Speed类也是直接继承于Action类的。
API文档中,对Speed类的解释如下:
Changes the speed of an action, making it take longer (speed>1) or less (speed<1) time.
Speed类的Create函数如下:
static Speed* create(ActionInterval* action, float speed);创建时需要传入一个ActionInterval类型的动作,和一个float类型的速度。
创建好Speed动作之后,可以获取速度,也可以修改速度,函数如下:
inline float getSpeed(void) const { return _speed; }inline void setSpeed(float speed) { _speed = speed; }
void setInnerAction(ActionInterval *action);inline ActionInterval* getInnerAction() const { return _innerAction; }
通过实际的例子,发现一个问题,API文档中的解释似乎不太对啊,速度设置大于1时,明显是更快了,也就是用的时间更少了,速度小于1时,动作更慢了,时间更长了。
这个结果是和API中的解释正好相反的。
0 0
- Cocos2d-x中,Speed类的使用
- cocos2d-x 中JniHelper类的使用
- Cocos2d-x中,Follow类的使用
- Cocos2d-x中,ProgressTo类的使用
- Cocos2d-x中颜色选择盘类CCControlColourPicker的使用
- Cocos2d-x中开关按钮类CCControlSwitch的使用
- Cocos2d-x中按钮类CCControlButton的使用
- Cocos2d-x中开关按钮类CCControlSwitch的使用
- cocos2d-x中CCTableView的使用
- cocos2d-x中schedule的使用
- Cocos2d-x 中 CCNotificationCenter 的使用
- cocos2d-x中CCTableView的使用
- Cocos2d-x中CCUserDefault的使用
- Cocos2d-x中控件CCControlStepper的使用
- cocos2d-x中luajit的使用
- cocos2d-x中CCTableView的使用
- cocos2d-x中定时器的使用
- cocos2d-x中精灵的使用
- Java中的break,continue,return
- Knockout应用开发指南(完整版) 目录索引
- 黑马程序员----Java集合框架学习笔记2 Map-工具类-泛型
- java类型转换
- HDU 1102 最小生成树
- Cocos2d-x中,Speed类的使用
- [深入Python]__new__和__init__
- PIC之中断
- Mysql 会导致锁表的语法
- 解决Python "no OPENSSL_Applink"错误
- 笔记本惠普CQ14-a003TX加装内存和SSD固态硬盘
- javascript函数
- Python 技巧:@classmethod 修饰符
- Python和Singleton (单件)模式