另一个想法是停止这个动作,然后在较慢的时间内重新开始,但是我不认为它会保持在相同的路径上,它可能看起来很奇怪.
这是我用来创建动作的代码.
CGMutablePathref cgpath = CGPathCreateMutable();CGPathMovetoPoint(cgpath,NulL,mysprite.position.x,mysprite.position.y);CGPathAddCurvetoPoint(cgpath,cp1.x,cp1.y,cp2.x,cp2.y,e.x,e.y);[mysprite runAction:[SKAction sequence:@[[SKAction followPath:cgpath asOffset:NO orIEnttopath:YES duration:3]]]];CGPathRelease(cgpath);解决方法 每个节点具有速度属性:
A speed modifIEr applIEd to all actions executed by a node and its
descendants.discussion
The default value is 1.0,which means that all actions run
at their normal speed. If you set a different speed,time appears to
run faster or slower for all actions executed on the node and its
descendants. For example,if you set a speed value of 2.0,actions run
twice as fast.
您可以将其设置为小于1的值,以使 *** 作更慢.甚至可以动画速度逐渐减慢:
[mySprite runAction:[SKAction speedTo:0.5 duration:1.0]];总结
以上是内存溢出为你收集整理的ios – 如何使用Sprite Kit减慢运行SKAction followPath的慢速运动效果的SKSpriteNode?全部内容,希望文章能够帮你解决ios – 如何使用Sprite Kit减慢运行SKAction followPath的慢速运动效果的SKSpriteNode?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)