2013-08-02 4 views
3

cocos2d iPhone 라이브러리에 둥근 모서리가있는 CCLayer 클래스의 하위 클래스를 만들 수있는 방법이 있습니까? 일부 솔루션이 이미 존재할 수 있습니까? 아이디어가 있으십니까?둥근 모서리가있는 CCLayer

감사합니다.

답변

3

원본 코드는 다음과 같습니다. 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]; 

가 다운로드 : CCRoundedRectNode 내가 코드를 사용하고 내가 편집 한 몇 가지 작은 문제 외에

+0

, 그것은 좋은 일

여기에 둥근 모서리 층 내 코드입니다. 그 점에 대해 대단히 감사합니다. 그러나이 물건에 들어가기 시작한 이래로 나는 이해할 수 없습니다. 왜 둥근 레이어를 너비가 960 인 240 너비로 만들어야합니까? –

관련 문제