所以我有最新的CCMotionStrike(使用ccVertexesLineToPolygon)。它在模拟器中按预期工作,但在设备上它一次只绘制一个段(我必须释放触摸并重绘,然后它将再次只绘制一个段)
//init method:
self.isTouchEnabled = YES;
CGSize s = [[CCDirector sharedDirector] winSize];
// create the streak object and add it to the scene
streak = [CCMotionStreak streakWithFade:2 minSeg:5 width:5 color:ccc3(255, 0, 0) image:@"streak.png"];
[self addChild:streak];
streak.position = ccp(s.width/2, s.height/2);
-(void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint touchLocation = [touch locationInView: [touch view]];
touchLocation = [[CCDirector sharedDirector] convertToGL: touchLocation];
[streak setPosition:touchLocation];
isDrawing = true;
}
答案 0 :(得分:0)
CCMotionStreak仅适用于一个连胜...
编辑:
将isDrawing = true;
放入ccTouchesBegan
和ccTouchesEnded
放isDrawing = false;
然后,将其从ccTouchesMoved
我怀疑这与它有什么关系,但我总是把streak.position = ccp(s.width/2, s.height/2);
放在[self addChild:streak];
之前