Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <CCLayerObject>.isTouchEnabled = YES;
- -(void)registerWithTouchDispatcher
- {
- [[[CCDirector sharedDirector] touchDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
- }
- -(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
- {
- CGPoint point = [self convertTouchToNodeSpace:touch];
- NSLog(@"X:%ftY:%f", point.x, point.y);
- }
- [self setUserInteractionEnabled:YES];
- - (void)touchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
- NSLog(@"touchBegan");
- }
- [self setMultipleTouchEnabled:YES];
- self.userInteractionEnabled = TRUE
- - (void)touchMoved:(UITouch *)touch withEvent:(UIEvent *)event
- {
- CGPoint touchLocation = [touch locationInNode:self];
- currentHero.position = touchLocation;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement