开发者

SubViews with Cocos2d

开发者 https://www.devze.com 2023-03-23 07:49 出处:网络
I have a helloworld scene that I would like to add a subview to. How is this done in cocos2d? I want to add a subview near the lower part of screen.

I have a helloworld scene that I would like to add a subview to.

How is this done in cocos2d? I want to add a subview near the lower part of screen.

I want this view to be controlled by the helloworld scene, hiding and showing the subview as needed.

How is this done in cocos2d?

Thank开发者_高级运维s


Add the subview (probably CCLayer) as a child to the hello world scene.

CCLayer* subview = //initialize
[subview setPosition:ccp(X,Y)];

[self addChild:subview];


You can add a CCLayer as a child to the CCScene or to the main CCLayer inside of it.

0

精彩评论

暂无评论...
验证码 换一张
取 消