ccaction

Using CCEaseOut together with CCSequence?

无人久伴 提交于 2019-12-12 03:10:08
问题 I want my action have an effect ease in / ease out, but I already have CCSequence. If I put CCEaseOut in front of my code, movement become weird. Is it possible to make CCEaseOut/CCEaseIn with CCSequence ? Here is my code : [player runAction:[CCSequence actions:[CCDelayTime actionWithDuration:1], [CCFadeTo actionWithDuration:2 opacity:255], [CCDelayTime actionWithDuration:1], [CCFadeTo actionWithDuration:7 opacity:0],nil]]; Thanks in advance 回答1: You can use CCEase* with most actions but not

Cocos2d - Actions and Animations are not paused

大兔子大兔子 提交于 2019-12-11 06:26:18
问题 When I do this: [gameLayer pauseSchedulerAndActions]; Most of the game pauses, but the sprites that are undergoing this action do not pause spinning: [sprite runAction:[CCRepeatForever actionWithAction:[CCRotateBy actionWithDuration:5.0 angle: 360]]]; Also, those sprites that are running CCAnimations do not stop animating: CCAnimation *theAnim = [CCAnimation animationWithSpriteFrames:theFrames delay:0.1]; CCSprite *theOverlay = [CCSprite spriteWithSpriteFrameName:@"whatever.png"]; self

Cocos2d - move a sprite from point A to point B in a sine wave motion

若如初见. 提交于 2019-12-10 09:27:09
问题 What would be the best way to do this? I see the CCEaseSineInOut action but it doesn't look like that could be used to do this. I need to move from one side of the screen to the other. The sprite should move in a sine-wave pattern across the screen. 回答1: I always like to have complete control over CCNode motion. I only use CCAction s to do very basic things. While your case sounds simple enough to possibly do with CCAction s, I will show you how to move a CCNode according to any function over

Cocos2d - move a sprite from point A to point B in a sine wave motion

*爱你&永不变心* 提交于 2019-12-05 17:32:24
What would be the best way to do this? I see the CCEaseSineInOut action but it doesn't look like that could be used to do this. I need to move from one side of the screen to the other. The sprite should move in a sine-wave pattern across the screen. I always like to have complete control over CCNode motion. I only use CCAction s to do very basic things. While your case sounds simple enough to possibly do with CCAction s, I will show you how to move a CCNode according to any function over time. You can also change scale, color, opacity, rotation, and even anchor point with the same technique.