cocos2d-x 动画加载 延时执行
来源:互联网 发布:sma4软件下载 编辑:程序博客网 时间:2024/05/19 20:57
void SnatchDeveloper::hechengframeCacheAction()
{
CCArray * hechengFrames=CCArray::create();
for (int i=0; i<8; i++)
{
std::string fileNmae=CCString::createWithFormat("0%d.png",i)->m_sString;
CCSpriteFrame * frame=hechengframeCache->spriteFrameByName(fileNmae.c_str());
hechengFrames->addObject(frame);
}
CCAnimation * animation = CCAnimation::createWithSpriteFrames(hechengFrames,0.3f);
animation->setRestoreOriginalFrame(true);
CCAnimate * action = CCAnimate::create(animation);
hechengSpite=CCSprite::create();
hechengSpite->runAction(CCRepeat::create(action, 1));
hechengSpite->setPosition(ccp(pageIconBg->getPositionX()+430,pageIconBg->getPositionY()+290));
addChild(hechengSpite);
CCCallFuncN * funcll= CCCallFuncN::create(this, callfuncN_selector(SnatchDeveloper::setDelayTime));
CCFiniteTimeAction * seq=CCSequence::create(action,CCDelayTime::create(0.5),funcll,NULL);
hechengSpite->runAction(seq);
}
void SnatchDeveloper::setDelayTime(CCNode * node)
{
node->removeFromParent();
PITipsMrg::Instance()->setMessageBox("合成成功!",false);
}
{
CCArray * hechengFrames=CCArray::create();
for (int i=0; i<8; i++)
{
std::string fileNmae=CCString::createWithFormat("0%d.png",i)->m_sString;
CCSpriteFrame * frame=hechengframeCache->spriteFrameByName(fileNmae.c_str());
hechengFrames->addObject(frame);
}
CCAnimation * animation = CCAnimation::createWithSpriteFrames(hechengFrames,0.3f);
animation->setRestoreOriginalFrame(true);
CCAnimate * action = CCAnimate::create(animation);
hechengSpite=CCSprite::create();
hechengSpite->runAction(CCRepeat::create(action, 1));
hechengSpite->setPosition(ccp(pageIconBg->getPositionX()+430,pageIconBg->getPositionY()+290));
addChild(hechengSpite);
CCCallFuncN * funcll= CCCallFuncN::create(this, callfuncN_selector(SnatchDeveloper::setDelayTime));
CCFiniteTimeAction * seq=CCSequence::create(action,CCDelayTime::create(0.5),funcll,NULL);
hechengSpite->runAction(seq);
}
void SnatchDeveloper::setDelayTime(CCNode * node)
{
node->removeFromParent();
PITipsMrg::Instance()->setMessageBox("合成成功!",false);
}
0 0
- cocos2d-x 动画加载 延时执行
- [寒江孤叶丶的Cocos2d-x之旅_04]Cocos2d-x延时执行动画或函数
- cocos2d-x - loading加载动画
- [Cocos2d-x] loading加载动画
- cocos2d-x 加载多张帧动画
- Cocos2d-x加载骨骼动画
- cocos2d-x 对一个普通方法进行延时执行操作
- Cocos2d-x 中加载骨骼动画资源
- cocos2d-x 3.10 C++加载动画
- Cocos2d-x 中加载骨骼动画资源
- Cocos2d-x 一边执行动作序列一边播放动画
- cocos2d-x 使用plist创建精灵并执行动画
- cocos2d-x游戏开发(十五)游戏加载动画loading界面
- cocos2d-x游戏开发(十五)游戏加载动画loading界面
- CocoStudio在Cocos2d-x Lua项目中的应用--加载动画
- CocoStudio在Cocos2d-x Lua项目中的应用--加载动画
- cocos2d-x游戏开发(十五)游戏加载动画loading界面
- [寒江孤叶丶的Cocos2d-x之旅_05]Cocos2d-x执行动画后删除自身
- 用enumitem宏包做一个首行空两格,第二行顶格的列表环境怎么做
- 深入理解JavaScript系列(12):变量对象(Variable Object)
- UIPanel Static属性限制子对象属性变化 check if widgets wont move
- 工作三年流水帐
- POST 提交数据过程中报403错误
- cocos2d-x 动画加载 延时执行
- cocos2d之Box2D详解 删除物理世界对象
- OC学习笔记之OC对象的内存管理二
- 深入理解JavaScript系列(13):This? Yes,this!
- ubuntu系统下创建软件桌面快捷方式
- 住家bm
- 根据选择的Checkbox动态在表格中列出选择的值
- 深入理解JavaScript系列(14):作用域链(Scope Chain)
- form表单action值的相对目录与绝对目录