-3
한 좌표에서 다음 좌표로 선을 그리시겠습니까? 트릭을 할해야키트를 사용하여 Swift 3에 선 그리기 Sprite
한 좌표에서 다음 좌표로 선을 그리시겠습니까? 트릭을 할해야키트를 사용하여 Swift 3에 선 그리기 Sprite
var aPath = UIBezierPath()
aPath.moveToPoint(CGPoint(x:/*Put starting Location*/ y:/*Put starting Location*/))
aPath.addLineToPoint(CGPoint(x:/*Put Next Location*/ y:/*Put Next Location*/))
//Keep using the method addLineToPoint until you get to the one where about to close the path
aPath.closePath()
//If you want to stroke it with a red color
UIColor.redColor().set()
aPath.stroke()
//If you want to fill it as well
aPath.fill()
}
. 에 refrence How to draw a line in the simplest way in swift
그것은 spritekit 아니에요 – iLandes
참조 : http://stackoverflow.com/questions/19092011/how-to-draw-a-line-in-sprite-kit?rq=1 – iLandes