图片显示,但是不播放动画,cocos2d-x 2.0.4,不知道哪位高手帮忙解答一下!
CCSprite* psptLight = CCSprite::create( "COG_Effect_Profile/Effect_Files_Original/101/image6.png" );
ASSERT_POINTER( psptLight );
//psptLight->setAnchorPoint( ANCHOR_POINT_RIGHTBOTTOM );
psptLight->setPosition( ccp( WIN_SIZE_WIDTH - 100, 20 ) );
addChild( psptLight );
CCAnimation* panmLight = CCAnimation::create();
ASSERT_POINTER( panmLight );
panmLight->addSpriteFrameWithFileName( "COG_Effect_Profile/Effect_Files_Original/101/image10.png" );
panmLight->addSpriteFrameWithFileName( "COG_Effect_Profile/Effect_Files_Original/101/image12.png" );
panmLight->addSpriteFrameWithFileName( "COG_Effect_Profile/Effect_Files_Original/101/image8.png" );
panmLight->addSpriteFrameWithFileName( "COG_Effect_Profile/Effect_Files_Original/101/image9.png" );
panmLight->addSpriteFrameWithFileName( "COG_Effect_Profile/Effect_Files_Original/101/image11.png" );
CCAnimate* pLightAnimAction = CCAnimate::create( panmLight );
ASSERT_POINTER( pLightAnimAction );
psptLight->runAction( pLightAnimAction);
pLightAnimAction->setDuration( 0.1f );
------解决方案--------------------
代码写在onenter 里了吗