Projects > cpp > Issues > Bug #1368

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Implement EffectsAdvancedTest (Effect4).

Bug #1368 [Closed]
dumganhar 2012-06-27 12:50 . Updated over 4 years ago
void Effect4::onEnter()
{
    EffectAdvanceTextLayer::onEnter();

    CCLens3D* lens = CCLens3D::create(ccp(100,180), 150, ccg(32,24), 10);
    CCActionInterval* move = CCJumpBy::create(5, ccp(380,0), 100, 4);
    CCActionInterval* move_back = move->reverse();
    CCActionInterval* seq = (CCActionInterval *)(CCSequence::create( move, move_back, NULL));

    /* In cocos2d-iphone, the type of action's target is 'id', so it supports using the instance of 'CCLens3D' as its target.
        While in cocos2d-x, the target of action only supports CCNode or its subclass,
        so we make an encapsulation for CCLens3D to achieve that.
    */

    CCDirector* director = CCDirector::sharedDirector();
    CCNode* pTarget = Lens3DTarget::create(lens);
    // Please make sure the target been added to its parent.
    this->addChild(pTarget);

    director->getActionManager()->addAction(seq, pTarget, false);
    this->runAction( lens );
}
dumganhar 2012-06-27 13:51
  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset commit:03afa55c5e989768b8ff5ad967965bbf3c166363.

dumganhar 2012-06-27 13:51

Applied in changeset commit:f57b14001600e4ddae6c2675f3d4ba7aedd20890.

zhangxm 2012-06-29 02:49
  • Status changed from Resolved to Closed

Atom PDF

Status:Closed
Start date:2012-06-27
Priority:Normal
Due date:
Assignee:dumganhar
% Done:

100%

Category:all
Target version:cocos2d-2.0-rc2-x-2.0.1

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.