Skip to content

Instantly share code, notes, and snippets.

@tanapon
Created March 14, 2012 17:19
Show Gist options
  • Save tanapon/2038017 to your computer and use it in GitHub Desktop.
Save tanapon/2038017 to your computer and use it in GitHub Desktop.
BoundingBoxToParent | Cocos2d
-(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