use*_*007 2 touchesbegan ios sprite-kit skshapenode swift
我正在寻找一种简单的方法来处理 SKShapeNode 子类中的触摸。为此,我尝试使用touchesBegan,但它不起作用..
class Shape: SKShapeNode {
convenience init(rectOfSize: CGSize, colorOfRectangle rectColor: UIColor) {
self.init()
self.init(rectOfSize: rectOfSize)
self.fillColor = rectColor
self.position = CGPointMake(rectOfSize.width, rectOfSize.height)
}
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
print("touch")
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
321 次 |
| 最近记录: |