首先,项目必须是 2D 的。
其次,上代码:
card_turning.gif
Director::getInstance()->setProjection(cocos2d::Director::Projection::_2D);
auto size = Director::getInstance()->getWinSize();
auto duration = 2;
auto card = Sprite::create("card2.png");
card->setPosition(100,100);
card->setVisible(false);
addChild(card);
card->runAction(Sequence::create(DelayTime::create(duration),
Show::create(),
OrbitCamera::create(duration, 1, 0, 270, 90, 0, 0),
NULL));
auto back = Sprite::create("back.png");
back->setPosition(card->getPosition());
addChild(back);
back->runAction(Sequence::create(OrbitCamera::create(duration, 1, 0, 0, 90, 0, 0),
Hide::create(),
DelayTime::create(duration),
NULL));
网友评论