相关疑难解决方法(0)

如何为每个象限创建一个圆形末端的圆

我创建了一个分为象限的圆圈.我试图让每个象限的末端四舍五入,每个象限之间有一个给定的间隙,但我得到了一些奇怪的行为.我想我错过了一些东西.下面是我得到的图像和相关代码.我希望结局类似于Apple Watch活动环.

在此输入图像描述

class GameScene: SKScene {

let radius = CGFloat(100)
var topRightPathNode : SKShapeNode!
var bottomRightPathNode : SKShapeNode!
var bottomLeftPathNode : SKShapeNode!
var topLeftPathNode : SKShapeNode!

override func didMove(to view: SKView) {

}


override init(size: CGSize) {
    super.init(size: size)
    let topRightPath = arcSegment(center: CGPoint.zero, radius: radius, strokeWidth: 18, gapWidth: 6)

    // TOP RIGHT


    topRightPathNode = SKShapeNode(path: topRightPath)
    topRightPathNode.fillColor = SKColor.white
    topRightPathNode.lineWidth = 0
    topRightPathNode.position = CGPoint(x: 320, y: 240)
    addChild(topRightPathNode)


    // BOTTOM RIGHT

    var reflectOnY = CGAffineTransform(scaleX: 1.0, y: -1.0) …
Run Code Online (Sandbox Code Playgroud)

sprite-kit skshapenode swift swift3

6
推荐指数
1
解决办法
590
查看次数

标签 统计

skshapenode ×1

sprite-kit ×1

swift ×1

swift3 ×1