Reputation: 571
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
Upvotes: 1
Views: 1125
Reputation: 28572
The reason for the strange output you are getting is that you are using the wrong string format specifiers. CGPoint
's x
and y
fields are CGFloat
s. You need to use %f
instead of %d
(which is for integers).
Upvotes: 2