현재 내 Sprite Kit 게임 내 자기장을 작업 중입니다.Sprite-Kit : SKFieldNode를 시각화하는 방법
private func initMagneticField(_ object: TileMapObjectMagneticField) {
let field = SKFieldNode.magneticField()
field.strength = 0.75
field.position = object.location
field.region = SKRegion(size: CGSize(width: 320.0, height: 320.0))
field.categoryBitMask = Globals.Categories.magneticField.rawValue
stage?.addChild(field)
}
자기장 지금까지 작동하지만, 나는 SKFieldNode
객체의 지역 특성을 배치하는 방법을 확실하지 오전 : 여기에 초기화 코드이다.
region: SKRegion
이나 필드 노드 자체를 표시하지 않는 물리적 시각화에 전환
과 region property
이 가지고도 size
도 position
속성 :
self.skView.showsPhysics = true
분야 자체를 시각화하거나 디버깅을 위해 적어도 region property
어떻게에 목적?
하는 0x14을 @ 1E : 차가워 요 - 고마워요! – salocinx