当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - CAKeyframeAnimation with path; can the path be extended to extend the animation?

问题描述:

You would be familiar with the games where a train moves slowly along a track that is made from puzzle pieces - if you can't tile more pieces onto the track the train crashes and you lose. One way to do this would be to make the train follow a path defined in a CAKeyframeAnimation.

Once the animation is created and added to the layer can you extend the path? (Maybe by maintaining a hold on the CGPathRef and adding to it) Or do you need to create a new path and new animation and replace the old one?

网友答案:

Yes you can - the animation proceeds along the path with appended paths just fine. Now that problem is solved the new problem is how to make animation progress according to touch inputs, not elapsed time.

分享给朋友:
您可能感兴趣的文章:
随机阅读: