【发布时间】:2013-09-26 11:36:36
【问题描述】:
SKAction *ghostAnimationAction =
[SKAction animateWithTextures:ghostFrames timePerFrame:0.1];
SKAction *ghostDelayAction =
[SKAction animateWithTextures:@[[SKTexture textureWithImageNamed:@"Ghost_"]]
timePerFrame:1.0];
SKAction *ghostAnimationSequence =
[SKAction sequence:@[ghostAnimationAction, ghostDelayAction]];
SKAction *repeatGhostAnimationSequence =
[SKAction repeatActionForever:ghostAnimationSequence];
我有一个由NSMutableArray 和SKTexture 对象组成的动画帧序列。播放完该序列后,我想在静止帧上折叠一秒钟,然后再重复所有内容。上面的代码有效,但我能找到指定在帧上保持一段时间的唯一方法是使用 animateWithTextures:timePerFrame: 并提供单个纹理数组。是否有另一种方法可以让SKAction 在我错过的时间内显示单个图像。
【问题讨论】:
-
请原谅格式,代码字段不会滚动,只是截断了文本,不知道为什么会像以前那样工作。
标签: iphone ios objective-c sprite-kit skaction