cocos2d-x CCMotionStreak 拖拽渐隐效果(切水果的刀?)

卸载init(()中

setTouchEnabled(true);

streak=CCMotionStreak::create(.25,3,64,ccWHITE,"CloseNormal.png");

addChild(streak);

streak->setPosition(ccp(size.width/2,size.height/2));

streak->tintWithColor(ccWHITE);

//重写ccTouchesMoved方法

void HelloWorld::ccTouchesMoved(CCSet* touches, CCEvent* event)
{
    CCSetIterator it = touches->begin();
    CCTouch* touch = (CCTouch*)(*it);
CCPoint touchLocation = touch->getLocation();    
     streak->setPosition( touchLocation );
}

cocos2d-x CCMotionStreak 拖拽渐隐效果(切水果的刀?)_第1张图片cocos2d-x CCMotionStreak 拖拽渐隐效果(切水果的刀?)_第2张图片cocos2d-x CCMotionStreak 拖拽渐隐效果(切水果的刀?)_第3张图片

你可能感兴趣的:(cocos2d-x)