在横向模式下显示启动图像?

发布于 2024-10-30 18:49:11 字数 137 浏览 2 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

花海 2024-11-06 18:49:11

难道你不能只制作横向图像并使用它吗?基本上就像泽泰森说的那样。

只需打开 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.

无声情话 2024-11-06 18:49:11

要使启动图像以横向模式显示,只需将 -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. change LaunchImage.png to LaunchImage-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's application: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.

内心旳酸楚 2024-11-06 18:49:11

只需在您最喜欢的图像编辑器(如 Photoshop)中旋转 Default.png 即可。

Just rotate the Default.png in your favourite image editor like Photoshop.

淑女气质 2024-11-06 18:49:11

我遇到了类似的问题,并通过在 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).

春庭雪 2024-11-06 18:49:11

AppDelegate applicatio:didFinishLaunchingWithOptions 中有一个调用
[director_pushScene: [IntroLayer 场景]]。在那里,它无耻地再次加载启动屏幕并将其旋转 90 度显示:

    if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) {
        background = [CCSprite spriteWithFile:@"Default.png"];
        background.rotation = 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:

    if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) {
        background = [CCSprite spriteWithFile:@"Default.png"];
        background.rotation = 90;
    }

Removing this fixes the rotating splash screen problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文