有什么方法可以在 cocos2d iPhone 库中创建圆角 CCLayer 类的子类吗? 也许一些解决方案已经存在? 有什么想法吗?
谢谢。
最佳答案
我在这里得到原始代码:A-roundedrectangle-ccnode-extension不适用于 cocos2d 2.0..所以做了一些更新。
这是我的圆角图层代码:
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];
关于ios - 带圆角的 CCLayer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18022489/