I have a CCLayer
subclass MyLayer
in which I handle touch events:
(BOOL) ccTouchBegan:(UITouch *) touch withEvent:(UIEvent *) event
I set the content size of MyLayer
instances like this:
`myLayer.contentSize = CGSizeMake(30.0, 30.0);`
I then add MyLayer
instances as children of ParentLayer
. For some reason I can tap anywhere on the screen and a MyLayer
instance will detect the tap. I want to only detect taps on the visible portion/content size. How can I do this?
Are the MyLayer
instances somehow inheriting a "tappable area" from somewhere else? I've verified that the contentSize
of the instance just tapped is (30, 30)
as expected. Perhaps the contentSize isn't the way to specify the tappable area of CCLayer
subclass.