Created
August 20, 2012 05:45
-
-
Save rockstar/3401380 to your computer and use it in GitHub Desktop.
cocos2d boundingBox highlight
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
-(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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works but I got a warning. Implicit declaration of function 'ccDrawPoly' is invalid in C99