수색…


터치 감지

SKScene 4 가지 메소드를 오버라이드하여 사용자 터치를 감지 할 수 있습니다.

class GameScene: SKScene {
    

    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {

    }
    
    override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) {
        
    }
    
    override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {
        
    }
    
    override func touchesCancelled(touches: Set<UITouch>?, withEvent event: UIEvent?) {
    
    }
}

각 메서드는 (특정 상황에서) 하나 이상의 단일 터치 이벤트를 포함 할 수있는 touches 매개 변수를받습니다.



Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow