- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想知道,如何更改 CCAnimation 中的延迟?
_monstrAnim = [CCAnimation animationWithFrames:monstrAnimFrames delay:0.1f];
self.monstr = [CCSprite spriteWithSpriteFrameName: [NSString stringWithFormat:@"monstr_%d_1.png", currentLevel]];
self.walkAction = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:_monstrAnim restoreOriginalFrame:NO]];
[self.monstr runAction:self.walkAction];
[monstrSpriteSheet addChild:self.monstr z:1];
这工作正常,但我应该改变 FPS 的速度,我做了...
[self.monstr stopAllActions];
[self.monstr runAction:self.walkAction];
[self.monstrAnim setDelay:1];
但什么也没发生...
最佳答案
停止您的 walkAction,然后更改动画的延迟,然后重新创建 Action 并再次运行它。如果你看一下 CCAnimate 的代码,你会看到,来自 CCAnimation 对象的帧之间的延迟仅在 Action 创建期间使用。所以这段代码
[self.monstr stopAllActions];
[self.monstrAnim setDelay:1.f];
self.walkAction = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:_monstrAnim restoreOriginalFrame:NO]];
[self.monstr runAction:self.walkAction];
会成功的。
关于cocos2d-iphone - 更改 CCAnimation 中的延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9944531/
我用cocos2d创建了一个新项目,然后创建了一个图层和一个 Sprite 。 我正在尝试将动画应用到我的 Sprite ,我发现了一些关于它的示例。但我不明白 CCAnimation 之间的区别和
我有一个 CCSpeed,其中包含一个 CCAnimation,它根据游戏中发生的事情动态地改变它的速度。有什么方法可以让动画在每次“滴答”(切换帧)时调用选择器,在这种特定情况下,以便播放声音? 编
我想知道,如何更改 CCAnimation 中的延迟? _monstrAnim = [CCAnimation animationWithFrames:monstrAnimFrames delay:0.
我不知道为什么,但我的动画不工作。我现在正在尝试通过 Sprite 表但通过一组 Sprite 添加一个动画单元。出了点问题下面是初始化方法的代码: @implementation Enemy -(i
它们似乎在我创建它们的那一刻就自动释放了 =s void SceneView::createAnimation(KillerRabbit* killerRabbit, std::string anim
最近我需要通过在 CCSprite 中使用 blendFunc 来改善我的应用程序的视觉效果。但是我不知道如何在CCAnimation中使用它。这是我的实现: CCSprite * test=[CCS
对于某人来说,这可能是一个非常快速和简单的答案,但作为一个菜鸟,我很难弄清楚它。我正在尝试运行我的 CCAnimation,然后运行第二个操作,在完成后从屏幕上删除动画。在到达这一点之前,我收到了“不
如何将音效与动画同步(CCAnimation) NSMutableArray* animationframes = [NSMutableArray array]; [a
看起来我的角色似乎使用 CCAnimation 和 Cocoa2d 3.x 制作了预期的动画。问题是当我将我的 CCAnimatedSprite 设置为具有 physicsBody 时,就像我以前的
不确定问题是否清楚,但我发现了这一点,并且想知道每次特定 Sprite 必须爆炸时调用的 runExplosionAnimation 方法是否会发生任何冲突。在我正在开发的游戏中,屏幕上可以有 20
我有一艘附有物理体的船。这艘船是静态物理体。船用 CCAnimateMoveTo 从左到右移动。当我点击屏幕时,我的角色倒下了。我很好地检测到碰撞。但我希望在碰撞后我的角色只是落在船上并继续移动。性格
我是一名优秀的程序员,十分优秀!