5
내가 지금은 컴파일러 오류 얻을, 그러나 빠른 2에서 '내 spritekit 개체에 대한 사용자 지정 경로를 생성 한 빠른 3에 대한 코드를 업데이트하고
Nil is not compatible with expected argument type 'Unsafe Pointer CGAffineTransform'
let offsetX = player.size.width * player.anchorPoint.x
let offsetY = player.size.height * player.anchorPoint.y
let path = CGMutablePath()
CGPathMoveToPoint(path, nil, 10 - offsetX, 16 - offsetY)
CGPathAddLineToPoint(path, nil, 10 - offsetX, 0 - offsetY)
CGPathAddLineToPoint(path, nil, 24 - offsetX, 0 - offsetY)
CGPathAddLineToPoint(path, nil, 24 - offsetX, 16 - offsetY)
CGPathAddLineToPoint(path, nil, 24 - offsetX, 16 - offsetY)
CGPathAddLineToPoint(path, nil, 28 - offsetX, 40 - offsetY)
CGPathAddLineToPoint(path, nil, 18 - offsetX, 46 - offsetY)
CGPathAddLineToPoint(path, nil, 6 - offsetX, 36 - offsetY)
CGPathAddLineToPoint(path, nil, 6 - offsetX, 18 - offsetY)
path.closeSubpath()
을
오류는 경로에 추가 할 때 두 번째 인수에 nil을 전달하는 것입니다. 안전하지 않은 포인터를 다음과 같이 전달하려고 시도했습니다.
var tr = CGAffineTransform.identity
CGPathMoveToPoint(path, &tr, 10 - offsetX, 16 - offsetY)
....
그러나 다른 이상한 오류가 발생했습니다.
CGPathMoveToPoint is unavailable. Use move(to: transform:)
그러나 인수 이름이있는 이동 기능이 없습니다. 그러나 이동 (toParent :)이있었습니다.
감사합니다! 변수를 점검하여 멤버 함수를 생각하지 않았습니다. – patrickd