This is my problem:
I work with SpriteKit and I want to ignore touch event when it occurs in some rectangle (prevent calling touchesBegan
). The way how I would like to do it is something like "overriding the hitTestWithEvent
of UIView
". But I can't find any similar method for SKSpriteNode
that could ignore event and prevent calling touchesBegan
.
Sure
- I could set
isUserInteractionEnabled
to false but it disables the whole sprite not just a part. - I could check location of touch in
touchesBegan
method, but this is to late - others sprites beneath at the same position will not receive this event anymore. - I also tried to use
SKCropNode
, but it just prevent displaying the sprite and events are handled even on the invisible area.
Does anybody have idea how to prevent part of sprite from handling an event?