Created
March 14, 2012 17:19
-
-
Save tanapon/2038017 to your computer and use it in GitHub Desktop.
BoundingBoxToParent | Cocos2d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(CGRect)boundingBoxOf:(CCNode*)node to:(CCNode*)parent | |
{ | |
CGRect box = [node boundingBox]; | |
CGPoint origin = box.origin; | |
origin.x = origin.x + parent.position.x; | |
origin.y = origin.y + parent.position.y; | |
box.origin = origin; | |
return box; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment