free4machine Member PM this user
Hi,
I want to make a sample animation:
there is a button at the bottom of the screen, a small menu will appear when this button is pressed. And there is an icon at the bottom of the small menu, the small menu will disappear when this icon is pressed.
The button, small menu, icon, all are instance of CCMenuItemImage .
Question: the small menu does not disappear when the icon is pressed. it seems that the icon does not respond for touch events.
Any suggestions or help will be appreciated
Sorry for my poor english.
here is the code:
CCMenuItemImage *bg = [CCMenuItemImage itemFromNormalImage:@"b1.png" selectedImage:@"b2.png" ];
CCMenuItemImage *button = [CCMenuItemImage itemFromNormalImage:@"button.png" selectedImage:@"button2.png" target: self selector:@selector(showSideMenu:)];
CCMenuItemImage *sideMenu = [CCMenuItemImage itemFromNormalImage:@"s1.png" selectedImage:@"s2.png" ];
CCMenuItemImage *backbutton = [CCMenuItemImage itemFromNormalImage:@"backbutton.png" selectedImage:@"backbutton2. png" target:self selector:@selector(hideSideMenu:)];
[ sideMenu addChild: backbutton ];
CCMenu *menu = [ CCMenu menuWithItems: bg,button, sideMenu, nil ];
[ self addChild: menu];
What did showSideMenu and hideSideMenu do is making sideMenu appear and disappear by using runAction.
thanks.