<分区>
您好,如果有人可以帮助我,那就太好了!
我需要获取滑动的坐标。我可以从 locationInNode 等获取初始触摸的坐标,但是我们如何获取滑动释放点的坐标?
func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
touched = true
for touch in touches {
location = touch.locationInNode(self)
print(location)
}
}
这就是我获取初始坐标的方式,我也为 touchesMoved 这样做了
override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) {
for touch in touches {
location = touch.locationInNode(self)
print(location)
}
使用此代码,它不会打印触摸时释放的最终坐标。
基本上我想用坐标来锻炼第一次触摸和释放滑动点之间的距离。 感谢您的帮助!!