Skip to content

Instantly share code, notes, and snippets.

@rockstar
Created August 20, 2012 05:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rockstar/3401380 to your computer and use it in GitHub Desktop.
Save rockstar/3401380 to your computer and use it in GitHub Desktop.
cocos2d boundingBox highlight
-(void)draw {
[super draw];
if (selected) {
CGRect rect = [self boundingBox];
CGPoint vertices[4] = {
ccp(0, 0),
ccp(0, rect.size.height),
ccp(rect.size.width, rect.size.height),
ccp(rect.size.width, 0)
};
glLineWidth(2);
ccDrawPoly(vertices, 4, YES);
}
}
@dmitriyl
Copy link

It works but I got a warning. Implicit declaration of function 'ccDrawPoly' is invalid in C99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment