Is there any way to create the subclass of CCLayer class with rounded corners in cocos2d iPhone library? Maybe some solutions already exists? Any ideas?
Thank you.
I got Original Code Here: A-roundedrectangle-ccnode-extension not worked in cocos2d 2.0..So done some updates.
Here is my code for rounded corner layer:
int layer_width = 200, layer_height = 100;
CCRoundedRectNode *shareRectNode = [[[CCRoundedRectNode alloc]
initWithRectSize: CGSizeMake(layer_width, layer_height)] autorelease];
shareRectNode.position = ccp(s.width/2-layer_width/2, s.height/2-layer_height/2);
shareRectNode.fillColor = ccc4f(0.0, 0.0, 0.0, 0.9);
[self addChild: shareRectNode z:3];
Download: CCRoundedRectNode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With