gargantuan
gargantuan

Reputation: 8944

Cocos 2d & CGPoint confusion in Landscape Mode

all, me again with another noob Cocos2d iphone question.

I've set my Director to Landscape, but when I was looking at the coordinates of the 'Touch Event' it was still picking them up as though the screen was portrait. So they were basically reversed.

x = 100, y = 50

should have been

x = 50, y = 100

No biggie, it was easily fixed by creating a new CGPoint and swapping the values around. However, it feels like there should be some neater way to do this. But I've not been able to find any reference to it. Is this the only way to do it or is there something built into Cocoa Touch or Cocos2d to fix this.

off topic: My God, iPhone is such a nice platform to develop for. And Obj-C is as cool as a cucumber. Sorry I just had to get that out of my system, non of my friends are programmers. They don't understand the pain of Internet explorer.

Upvotes: 2

Views: 1245

Answers (1)

lhunath
lhunath

Reputation: 125616

cocosTouchPoint = [[Director sharedDirector] convertToGL:touchPoint];

Upvotes: 4

Related Questions