
let rectangle = SKShapeNode() rectangle.path = UIBezIErPath(rect: CGRectMake(vIEw.frame.wIDth/4,vIEw.frame.height/2,vIEw.frame.wIDth/2,vIEw.frame.wIDth/2)).CGPath rectangle.fillcolor = UIcolor.yellowcolor() rectangle.strokecolor = UIcolor.yellowcolor() let oneRevolution = SKAction.rotateByAngle(360,duration: 100.0) let repeat = SKAction.repeatActionForever(oneRevolution) rectangle.runAction(repeat)解决方法 您是否看过SKShapeNode文档: https://developer.apple.com/library/IOs/documentation/SpriteKit/Reference/SKShapeNode_Ref/index.html
尝试使用:
shapeNodeWithPath:centered:
选择“是”进行居中.
总结If YES,the path is translated so that the center of the path’s bounding Box is at the node’s origin; otherwise the path is relative to the node’s origin.
以上是内存溢出为你收集整理的ios – 沿着中心旋转SKShapeNode全部内容,希望文章能够帮你解决ios – 沿着中心旋转SKShapeNode所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)