Created
November 16, 2016 23:59
-
-
Save stepheng/74c641829d0015b9be2935b6164ff264 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func dashedLineNode(start: CGPoint, end: CGPoint, pattern: [CGFloat] = [10, 10]) -> SKNode { | |
let bezierPath = CGMutablePath() | |
bezierPath.move(to: start) | |
bezierPath.addLine(to: end) | |
let dashed = bezierPath.copy(dashingWithPhase: pattern[0] / 2, lengths: pattern) | |
return SKShapeNode(path: dashed) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment