my scene has 2 layers, game,and buttons, with :
+(CCScene *) scene
{
// 'scene' is an autorelease object.
CCScene *scene = [CCScene node];
// 'layer' is an autorelease object.
mainScene *layer = [mainScene node];
buttons *layer2=[buttons node];
layer.tag=30;
layer2.tag=40;
[scene addChild:layer2 z:1];
[scene addChild: layer];
// return the scene
return scene;
}
then i am trying to make him invisible when touch on screen with :
[[self getChildByTag:40] setVisible:NO];
nothing is happen.
what am i doing wrong ?
thanks a lot .
The scene contains the layer, not
self, so you need to call[[[self parent] getChildByTag:40] setVisible:NO];