Location wrong in touchesBegan

467 views Asked by At

So I am using GLKViewController and GLKView. I am debugging my app on iPhone 5s and if I view the drawableHeight and drawableWidth for the view it shows as 1136 and 640 which is correct for iphone 5s. However when I check the following code.

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    startTime = CFAbsoluteTimeGetCurrent();
    self.lastGestureTime = startTime;
    active = true;
    UITouch *touch = [ touches anyObject ];
    CGPoint _location = [ touch locationInView:self.view ];

and I click the bottom-right of the screen I get the location as 316 and 533 which is approximately half of what I expect the co-ordinates to be. So the location anywhere on the screen is getting sized to exactly half of what I expect it to be. My UI displays correctly so the buttons are all in the right place, but the location from locationInView comes out wrong ( I think it is exactly half of what it should be ). Any help would be great.

0

There are 0 answers