开发者

syncing sound with CCAnimation

开发者 https://www.devze.com 2023-03-02 20:39 出处:网络
I have a CCSpeed that contains a CCAnimation that dynamically changes it\'s speed based on stuff that\'s going on in the game. Is there any way i can get the 开发者_开发问答animation to call a selecto

I have a CCSpeed that contains a CCAnimation that dynamically changes it's speed based on stuff that's going on in the game. Is there any way i can get the 开发者_开发问答animation to call a selector each time the animation "ticks" (switches frame), in this specific case, in order to play a sound?

Edit: Other solutions to sync the animation ticks with sound are welcome as well


I wonder if QuartzCore/CADisplayLink might be what you're looking for.

You can create one with -[UIScreen - displayLinkWithTarget:selector: ]

You can get a callback for every screen refresh (VBL) cycle.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号