美文网首页
1017 - 扑克翻拍

1017 - 扑克翻拍

作者: 自由快挂 | 来源:发表于2017-10-17 00:44 被阅读25次

    首先,项目必须是 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));
    

    相关文章

      网友评论

          本文标题:1017 - 扑克翻拍

          本文链接:https://www.haomeiwen.com/subject/odrruxtx.html