Skip to content

Instantly share code, notes, and snippets.

@rockstar
Created August 20, 2012 05:45
Show Gist options
  • Select an option

  • Save rockstar/3401380 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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