我正在用 Sprite Kit 画画。我想检测用户的图纸何时相交。
我试图遵循代码,但它不起作用。似乎精灵套件并没有节省所有积分:
override func touchesMoved(touches: NSSet, withEvent event: UIEvent) {
/* Called when a touch begins */
touch = touches.anyObject() as UITouch!
for drawingPoint in drawingPoints{
if(touch.locationInNode(self) == drawingPoint){println(true)}
}
drawingPoints.append(touch.locationInNode(self))
}