My question is that, I was using this method before it was working perfectly, today am trying to do it in another project. This is the code
- (void) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch* touch = [touches anyObject];
CGPoint touchPos = [[CCDirector sharedDirector] convertToGL:[touch locationInView:[touch view]]];
CCLOG(@"( %d , %d )",touchPos.x,touchPos.y);
}
What I’m getting is strange output the output is always similar to this ( 0 , 1081286656 )
I would love if someone could help me
Best Regards
Ahmed
The reason for the strange output you are getting is that you are using the wrong string format specifiers.
CGPoint‘sxandyfields areCGFloats. You need to use%finstead of%d(which is for integers).