Can't tap SKSpriteNode - no touch detected ios

后端 未结 4 566
萌比男神i
萌比男神i 2021-01-12 08:49

I am pretty new to iOS, objective C and working with Xcode. I only did one simple news type app, but now I would like to create a game I had published on another platform.

4条回答
  •  伪装坚强ぢ
    2021-01-12 08:57

    I never used the SKSprite framework but I will try to help. First, your function "-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event" has to be set in your custom SKSpriteNode class, if not it's normal if that doesn't work.

    If it's already done, you have to search where the tap is handle (by an other object) then you can use : "- (BOOL)gestureRecognizer:(UIPanGestureRecognizer )gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UISwipeGestureRecognizer)otherGestureRecognizer"

    hope that will help !

提交回复
热议问题