在横向模式下显示启动图像?
我正在使用 Cocos2d 和 Xcode 4。我的应用程序当前以纵向模式显示启动图像,然后切换到横向模式,使图像位于其一侧,然后启动应用程序。我怎样才能: 1. 让它运行启动映像一段时间。 2. 使其以横向模式显示,而不是纵向模式。 任何帮助表示赞赏。谢谢!
I am using Cocos2d and Xcode 4. My app currently displays the launch image in portrait mode, then switches to landscape so the image is on its side, then launches the app. How can I:
1. Make it run the launch image for a certain duration.
2. Make it display it in Landscape mode, not portrait.
Any Help is appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
难道你不能只制作横向图像并使用它吗?基本上就像泽泰森说的那样。
只需打开 gimp 或 Photoshop 并制作一个新图像:480w X 320h。
Can't you just make your image in landscape and use that? Basically like what zeiteisen said.
Just open up gimp or photoshop and make a new image: 480w X 320h.
要使启动图像以横向模式显示,只需将
-Landscape
附加到其文件名(例如,将LaunchImage.png
更改为LaunchImage-Landscape.png
)。至于在一定时间内显示启动图像,您有两种选择:首先显示“启动图像”视图控制器,并在所需的持续时间后将其关闭(允许您淡出图像等),或者只需调用
sleep()
在您的应用委托的application:didFinishLaunchingWithOptions:
中。需要注意的是,在控制权传递给应用程序委托之前,您无法控制操作系统显示启动图像的时间,您需要考虑到这一点。To make your launch image display in landscape mode, simply append
-Landscape
to its filename (e.g. changeLaunchImage.png
toLaunchImage-Landscape.png
).As for showing your launch image for a certain duration, you have two options: display a "launch image" view controller initially and dismiss it after the desired duration (allows you to fade the image out, etc.), or simply call
sleep()
in your app delegate'sapplication:didFinishLaunchingWithOptions:
. It's important to note that you have no control over how long the OS displays your launch image before control is passed to your app delegate—you need to take this into consideration.只需在您最喜欢的图像编辑器(如 Photoshop)中旋转 Default.png 即可。
Just rotate the Default.png in your favourite image editor like Photoshop.
我遇到了类似的问题,并通过在 Interface Builder 中将视图更改为横向来修复它。我的仍然是动画,尽管从窗口的初始纵向方向(在 IB 中不可设置为横向)。
I had a similar problem and fixed it by changing the view to landscape in Interface Builder. Mine is still animating though from the initial portrait orientation of the Window (not settable to landscape in IB).
在
AppDelegate applicatio:didFinishLaunchingWithOptions
中有一个调用[director_pushScene: [IntroLayer 场景]]
。在那里,它无耻地再次加载启动屏幕并将其旋转 90 度显示:删除此修复了旋转启动屏幕问题。
In
AppDelegate applicatio:didFinishLaunchingWithOptions
there is a call to[director_ pushScene: [IntroLayer scene]]
. In there, it shamelessly loads the splash screen again and displays it rotated by 90 degrees:Removing this fixes the rotating splash screen problem.