Hi,
I'm having a bit of trouble keeping orientations the same between a bunch of different systems I'm using and was wondering if there was some small thing I'm overlooking. The App I'm currently working on uses UIKit for it's interface, Cocos for it's rendering, and a lot of render to texture for it's actual visual look. All of these elements are visible/interactive at once.
The problem I'm having it that everything seems to be using different coordinate systems. I have cocos set to LandscapeLeft, and create my interface in UIKit in the same orientation. However, when I add the view with:
[[[Director sharedDirector] openGLView] addSubview:MyViewController.view];
It doesn't obey the correct orientation and must be manually rotated on the ViewController's post-load function. No big deal, however, once the view is rotated, touch events propagated down to the cocos scene are also rotated by 90 degrees. Do I need to somehow tell the view controller it's in landscape Left instead of rotating it?
The next orientation problem I have is with Render to texture techniques (based off the grabber class and posted in a few of these threads). For some reason, when I render a scene to a texture in LandScapeLeft, I have to rotate the scene back to normal rotation before rendering. Note that the scene renders fine in both cases, but if I don't do the rotation the texture it's rendering into it too small and gets clipped to the smaller of the sides. In other words, it's 320x480 instead of being 480x320. This issue appears to be independent of UIKit, as it happens in non UIKit projects as well.