gpt4 book ai didi

iphone - 如何使 cocos2d Sprite 每秒缩放(以获得脉动效果)?

转载 作者:行者123 更新时间:2023-12-03 18:38:02 26 4
gpt4 key购买 nike

我想让 Sprite 每秒缩放一次,使其看起来像是鼓起来并脉动。我怎样才能做到这一点?

最佳答案

由于之前的帖子包含语法错误。更准确地说,我发布了工作代码:

CCSprite * sprite = ...; // create the sprite.
id scaleUpAction = [CCEaseInOut actionWithAction:[CCScaleTo actionWithDuration:1 scaleX:1.0 scaleY:1.0] rate:2.0];
id scaleDownAction = [CCEaseInOut actionWithAction:[CCScaleTo actionWithDuration:0.5 scaleX:0.8 scaleY:0.8] rate:2.0];
CCSequence *scaleSeq = [CCSequence actions:scaleUpAction, scaleDownAction, nil];
[sprite runAction:[CCRepeatForever actionWithAction:scaleSeq]];

关于iphone - 如何使 cocos2d Sprite 每秒缩放(以获得脉动效果)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3185186/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com