任何人都可以帮助我。我正在尝试使用多个ccbezierpaths创建一个路径。这是我的代码。
self.move_duration = 1;
self.position = ccp((winSize.width)*0, (winSize.height)*0.5);
ccBezierConfig bezier1;
bezier1.controlPoint_1 = ccp((winSize.width)*0, (winSize.height)*0.5); // control point 1
bezier1.controlPoint_2 = ccp((winSize.width)*0.125, (winSize.height)*0.833); // control point 2
bezier1.endPosition = ccp((winSize.width)*0.25, (winSize.height)*0.5);
ccBezierConfig bezier2;
bezier2.controlPoint_1 = ccp((winSize.width)*0.375, (winSize.height)*0.833); // control point 1
bezier2.controlPoint_2 = ccp((winSize.width)*0.5, (winSize.height)*0.5); // control point 2
bezier2.endPosition = ccp((winSize.width)*0.625, (winSize.height)*0.833);
ccBezierConfig bezier3;
bezier3.controlPoint_1 = ccp((winSize.width)*0.75, (winSize.height)*0.5); // control point 1
bezier3.controlPoint_2 = ccp((winSize.width)*0.875, (winSize.height)*0.833); // control point 2
bezier3.endPosition = ccp((winSize.width), (winSize.height)*0.5);
id bezierto1 = [CCBezierTo actionWithDuration:self.move_duration bezier:bezier1];
id bezierto2 = [CCBezierTo actionWithDuration:self.move_duration bezier:bezier2];
id bezierto3 = [CCBezierTo actionWithDuration:self.move_duration bezier:bezier3];
它进入一个奇怪的道路。有没有人知道这是如何做到的。感谢您的时间和帮助
抱歉,对于描述如此模糊。我希望看到贝塞尔运动在终点结束然后另一个从那里开始。相反它正在做这个http://i.imgur.com/xZC6INa.png,感谢你的建议和图像迈克。
答案 0 :(得分:1)
使用
id seq = [CCSequence actions:bezierto1,bezierto2,bezierto3,nil];
[self runAction:seq];
并假设cocos2d 2.x。