大佬教程收集整理的这篇文章主要介绍了ios – 作为一个单元旋转时重叠的SpriteNodes,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
override func touchesBegan(_ touches: Set<UITouch>,with event: UIEvent?) { for touch in touches{ let LOCATIOn = touch.LOCATIOn(in: self) if LOCATIOn.x < 0 { blueTriLeft.run(SKAction.rotate(byAngle: CGFloat(M_PI_2),duration: 0.2)) redTriLeft.run(SKAction.rotate(byAngle: CGFloat(M_PI_2),duration: 0.2)) yellowTriLeft.run(SKAction.rotate(byAngle: CGFloat(M_PI_2),duration: 0.2)) greenTriLeft.run(SKAction.rotate(byAngle: CGFloat(M_PI_2),duration: 0.2)) } else if LOCATIOn.x > 0 { blueTriRight.run(SKAction.rotate(byAngle: CGFloat(-M_PI_2),duration: 0.2)) redTriRight.run(SKAction.rotate(byAngle: CGFloat(-M_PI_2),duration: 0.2)) yellowTriRight.run(SKAction.rotate(byAngle: CGFloat(-M_PI_2),duration: 0.2)) greenTriRight.run(SKAction.rotate(byAngle: CGFloat(-M_PI_2),duration: 0.2)) } } }
下面是我的广场的图片,由四个独立的三角形组成@H_801_7@
请随时向我询问您需要查看的任何其他代码,任何输入都有帮助.此外,我无法在行动中得到重叠的问题,所以提前抱歉,但我会尽力去做.@H_801_7@
// This is the configuration to do in sceneDidLoad let node = SKNode() node.addChild(blueTriLeft) node.addChild(redTriLeft) node.addChild(yellowTriLeft) node.addChild(greenTriLeft) scene.addChild(nodE) // Inside touchesBegan(_:,with:) node.run(SKAction.rotate(byAngle: CGFloat(-M_PI_2),duration: 0.2))
以上是大佬教程为你收集整理的ios – 作为一个单元旋转时重叠的SpriteNodes全部内容,希望文章能够帮你解决ios – 作为一个单元旋转时重叠的SpriteNodes所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。