I have added a menu when touchesMove fonction is been called as:
CCMenuItemImage * resetPosition =[CCMenuItemImage itemFromNormalImage:@"position.png" selectedImage: @"position_over.png" target:self
selector:@selector(reset:)];
resetPosition.position =ccp(400, 300);
myresetMenu = [CCMenu menuWithItems:resetPosition, nil];
myresetMenu.position = ccp(0,0);
[[self parent] addChild:myresetMenu z:10];
menuWithItems:resetPosition, nil];
And then in reset method i have removed this menu as:
- (void) reset: (CCMenuItem *) menuItem
{
[self unschedule:@selector(reset:)];
[[self parent] removeChild:myresetMenu cleanup:YES];
[[SimpleAudioEngine sharedEngine] playEffect:@"btn_click.mp3"];
[self.parent runAction:[CCMoveTo actionWithDuration:(-self.parent.position.x/650) position:ccp(0,0)]];
}
but myresetMenu is nor been removed. please assist me with it.
I know this is not exactly the answer of my question, but i have achieved the solution in given way.
Well I have implemented it by the following way:
And in case of disable a transparent small button is been used.