gpt4 book ai didi

ios - SKAction scaleBy : duration: SpriteKit

转载 作者:可可西里 更新时间:2023-11-01 05:35:47 26 4
gpt4 key购买 nike

我在尝试使用 [SKAction scaleBy: duration:]

使一个圆圈变大和变小时遇到了麻烦
SKAction *scaleDown = [SKAction scaleBy:0.2 duration:1.8];  
SKAction *scaleUp= [scaleDown reversedAction];
SKAction *fullScale = [SKAction sequence:@[scaleDown, scaleUp, scaleDown, scaleUp]];
[_circleChanging runAction:fullScale];

我得到的是圆圈变得如此之小,以至于消失了,然后就再也没有回来。它必须变小,然后恢复到原来的大小,重复 2 次。

最佳答案

尝试:

  SKAction *scaleDown = [SKAction scaleTo:0.2 duration:0.75];
SKAction *scaleUp= [SKAction scaleTo:1.0 duration:0.75];
SKAction *fullScale = [SKAction repeatActionForever:[SKAction sequence:@[scaleDown, scaleUp, scaleDown, scaleUp]]];
[_circleChanging runAction:fullScale];

关于ios - SKAction scaleBy : duration: SpriteKit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20355564/

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