Swift2 에서 사용되던 CGRectMake, CGPointMake, CGSizeMake, CGRectZero, CGPointZero가 Swift3에선 바뀌었다.
CGVector(dx: Int, dy: Int)
CGPoint(x: Double, y: Double)
CGSize(width: Int, height: Int)
Example:
Example:
let newPoint = stackMid.convert(CGPoint(x: -10, y: 10), to: self)
self.physicsWorld.gravity = CGVector(dx: 0, dy: gravity)
hero.physicsBody = SKPhysicsBody(rectangleOf: CGSize(width: 16, height: 18))
let back = SKShapeNode(rect: CGRect(x: 0-120, y: 1024-200-30, width: 240, height: 140), cornerRadius: 20)
self.physicsWorld.gravity = CGVector(dx: 0, dy: gravity)
hero.physicsBody = SKPhysicsBody(rectangleOf: CGSize(width: 16, height: 18))
let back = SKShapeNode(rect: CGRect(x: 0-120, y: 1024-200-30, width: 240, height: 140), cornerRadius: 20)
더 자세한 내용은 아래 참조
댓글 없음:
댓글 쓰기