Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (BOOL)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- {
- UITouch *touch = [touches anyObject];
- if( touch )
- {
- CGPoint location = [touch locationInView: [touch view]];
- CGPoint convertedPoint = [[Director sharedDirector] convertToGL:location];
- int x= convertedPoint.x;
- int y = convertedPoint.y;
- if (menuOn)
- {
- startState=NO;
- if (CGRectContainsPoint(MYes,convertedPoint))
- {
- [self onMenu];
- }
- else if (CGRectContainsPoint(MNo,convertedPoint))
- {
- startState=NO;
- menuOn=NO;
- [menuPopup setVisible:NO];
- }
- }
- else if (resetOn)
- {
- startState=NO;
- if (CGRectContainsPoint(MYes,convertedPoint))
- {
- resetOn=NO;
- [resetPopup setVisible:NO];
- [self onReset];
- }
- else if (CGRectContainsPoint(MNo,convertedPoint))
- {
- startState=NO;
- resetOn=NO;
- [resetPopup setVisible:NO];
- }
- }
- else if (startState)
- {
- startState=NO;
- if (CGRectContainsPoint(menuL,convertedPoint))
- {
- menuSel=YES;
- }
- else if (CGRectContainsPoint(resetL,convertedPoint))
- {
- resetSel=YES;
- }
- else
- {
- selectedSprite = [self getSprite :x :y];
- if (selectedSprite != -1) moveState=YES;
- }
- }
- // no other handlers will receive this event
- return kEventHandled;
- }
- // we ignore the event. Other rec
- return kEventIgnored;
- }
Add Comment
Please, Sign In to add comment