gpt4 book ai didi

swift 3(SpriteKit): Change the properties of each line in CGPath

转载 作者:行者123 更新时间:2023-11-30 12:48:53 29 4
gpt4 key购买 nike

我想知道对于添加到 CGPath 的每条线,您是否可以更改它的属性,例如 lineWidth 和 strokeColor。目前我创建的 CGPath 如下:

let path = CGMutablePath()

points = [CGPoint(x: -372, y: -250), CGPoint(x: 372, y: -250)]
path.move(to: CGPoint(x: points[0].x, y: points[0].y))
//Somewhere here change the properties of the line before adding it
path.addLine(to: CGPoint(x: points[1].x, y: points[1].y))
//Or after here

Line.path = path

是否可以单独更改添加到 CGPath 的每条线的属性,或者整个 CGPath 只有一组颜色和线宽?

最佳答案

事情比你想象的要糟糕得多。 CGPath 的可变部分是一个谎言。

关于 swift 3(SpriteKit): Change the properties of each line in CGPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41259634/

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