I have CCSprite
which (for reasons I'll gloss over here) has some padding around its edges. I'm creating the sprite from a sprite sheet, and it is continuously animating. Here, I've added a semi-transparent blue sprite to show the contentSize
of the sprite. I've also turned on CC_SPRITE_DEBUG_DRAW
in order to draw borders around (both) sprites:
Thus, the blue box represents the boundingBox
/ contentSize
properties of CCSprite
. texture. This is correct, desired functionality.
However... as you can see, CC_SPRITE_DEBUG_DRAW
is able to recognize the actual edges of the drawn texture. I'd like to access the actual "drawn area" (eg, as a CGRect
). In other words: I want to be able to detect if the user touched on the unit as opposed to simply in the blue box (boundingBox
).
How can I access this CGRect
?