0

在我的图层中,我添加了一个图像视图,然后我想在图像视图的顶部添加 CCMenuItem 图像。我如何在 Cocos2d 中做到这一点

给我任何建议

编辑:从评论中移动代码

img = [[UIImageView alloc]initWithFrame:CGRectMake(0, 35, 320, 480)]; 
img.backgroundColor=[UIColor clearColor];
[[[CCDirector sharedDirector] openGLView] addSubview: img];
CCMenuItemImage *topBarBtn1 = [CCMenuItemImage itemFromNormalImage:@"TapButtonR.png" 
                                                     selectedImage:@"TapButtonR.png"             
                                                            target:self 
                                                          selector:@selector(gamePlay:)]; 
CCMenu *tapScreen = [CCMenu menuWithItems:topBarBtn1, nil]; 
tapScreen.position = ccp(160, 70); 
[self addChild:tapScreen z:2 ];
4

0 回答 0