在Cocos2d项目中获取不自动旋转的方向
我有一个小问题,我找不到任何解决方案。如何关闭视图和 ogl 的自动旋转并仍然获得方向?
例如,如果我将 GAME_AUTOROTATION
设置为 kGameAutorotationNone
,通知中心 UIApplicationDidChangeStatusBarOrientationNotification
将不起作用。 如果我允许 shouldAutorotateToInterfaceOrientation
两个方向自动旋转再次出现。如果我实现一个空白的 willRotateToInterfaceOrientation
则不会发生任何变化。
那么,如何在不实际旋转任何东西的情况下改变方向呢?
提前致谢。
I have a small issue and I can't find any solution. How can I turn off autorotation for views and ogl and still get Orientation?
For example if I set GAME_AUTOROTATION
to kGameAutorotationNone
the notification center UIApplicationDidChangeStatusBarOrientationNotification
doesn't work.
If I allow in shouldAutorotateToInterfaceOrientation
two orientations autorotation appear again. If I implement a blank willRotateToInterfaceOrientation
nothing change.
So, how can I get orientations change without actually rotate anything?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过旋转当前的CCLayer/CCScene来管理自己的方向方法。在 willRotateToInterfaceOrientation 方法上。但请确保,您将在所有 3 个触摸事件中获得错误的触摸像素......!在进行计算之前,您必须根据您的方向修改触摸坐标。
You can manage your own orientation method by rotating your Current CCLayer/CCScene. on willRotateToInterfaceOrientation method. But make sure, you will get WRONG touch pixels on all 3 touch events..! You have to modify the touch-cordinates according to your orientation them before taking them in calculations.