佚名通过本文主要向大家介绍了大神note3,酷派大神f2,大神,大神官网,大神引入怀 101个深吻等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 自学COCOS动画创建的时候遇到的一个断言异常,望大神们指点迷津
描述:
CCSprite*sprite=CCSprite::create("T1.png");
CCSpriteFrame*frame1=CCSpriteFrame::create("T1.PNG",CCRectMake(0,0,60,60));
CCSpriteFrame*frame2=CCSpriteFrame::create("T2.PNG",CCRectMake(0,0,60,60));
CCSpriteFrame*frame3=CCSpriteFrame::create("T3.PNG",CCRectMake(0,0,60,60));
CCSpriteFrame*frame4=CCSpriteFrame::create("T4.PNG",CCRectMake(0,0,60,60));
CCSpriteFrame*frame5=CCSpriteFrame::create("T5.PNG",CCRectMake(0,0,60,60));
CCArray *array=CCArray::createWithCapacity(5);
array->addObject(frame1);
array->addObject(frame2);
array->addObject(frame3);
array->addObject(frame4);
array->addObject(frame5);
CCAnimation*animation=CCAnimation::create(array,0.15f);
CCAnimate*animate=CCAnimate::create(animation);
sprite->setPosition(ccp(100,85));
this->addChild(sprite,2);
sprite->runAction(animate);
之前没用数组存储动画帧对象的时候,程序能正常运行。然后发现自己创建动画的方式有误,故用数组来存贮帧对象然后用其初始化序列帧对象,结果报错。
错误详情如下:

望大神们指点指点,不胜感激
描述:
动画COCOS2DX异常
代码如下:CCSprite*sprite=CCSprite::create("T1.png");
CCSpriteFrame*frame1=CCSpriteFrame::create("T1.PNG",CCRectMake(0,0,60,60));
CCSpriteFrame*frame2=CCSpriteFrame::create("T2.PNG",CCRectMake(0,0,60,60));
CCSpriteFrame*frame3=CCSpriteFrame::create("T3.PNG",CCRectMake(0,0,60,60));
CCSpriteFrame*frame4=CCSpriteFrame::create("T4.PNG",CCRectMake(0,0,60,60));
CCSpriteFrame*frame5=CCSpriteFrame::create("T5.PNG",CCRectMake(0,0,60,60));
CCArray *array=CCArray::createWithCapacity(5);
array->addObject(frame1);
array->addObject(frame2);
array->addObject(frame3);
array->addObject(frame4);
array->addObject(frame5);
CCAnimation*animation=CCAnimation::create(array,0.15f);
CCAnimate*animate=CCAnimate::create(animation);
sprite->setPosition(ccp(100,85));
this->addChild(sprite,2);
sprite->runAction(animate);
之前没用数组存储动画帧对象的时候,程序能正常运行。然后发现自己创建动画的方式有误,故用数组来存贮帧对象然后用其初始化序列帧对象,结果报错。
错误详情如下:

望大神们指点指点,不胜感激