启动画面就像点击复仇3

发布于 2024-08-06 22:46:35 字数 139 浏览 3 评论 0原文

感谢您花时间阅读此消息。我希望你能够回答我的问题。

我想在现有项目中添加一个类似于《点按复仇 3》的启动画面。 它基本上显示一个屏幕 2 秒,然后另一个屏幕 2 秒,然后立即显示菜单。

谁能告诉我如何才能创造出这样的东西? 谢谢 。

thank you for taking your time to read this message. I hope you are able to answer my question.

I would like to add a splash screen to an existing project similar to that of tap tap revenge 3.
it basically shows one screen for 2 seconds then another for 2 seconds and then it just shows the menu straight away.

Can anyone tell me how i would be able to create something like that?
thanks
.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

柒七 2024-08-13 22:46:35

显然,对于启动画面的看法各不相同。然而,做 TTR 所做的事情非常简单;您的第一个屏幕有一个 Default.png 文件。然后,使您在启动时加载的顶视图控制器成为一个简单的图像,这就是您的第二个屏幕。

诀窍是尽可能多地卸载启动代码,并将其推迟到初始启动之后。启动和 applicationDidFinishLaunching: 结束之间的任何操作都将在显示 Default.png 屏幕时完成。使用 -performSelector:withObject:afterDelay: 推迟“昂贵”的调用,以便您可以快速到达第二个启动屏幕。

Obviously opinions on splash screens vary. However, to do what TTR does is pretty simple; have a single Default.png file for your first screen. Then, make the top view controller you load at startup a simple image, and that's your second screen.

The trick is too offload as much of your startup code as possible, and defer it to after the initial launch. Anything done= between startup and the end of applicationDidFinishLaunching: will be done while your Default.png screen is shown. Use -performSelector:withObject:afterDelay: to defer 'expensive' calls, so that you can quickly get to your second splash screen.

我的奇迹 2024-08-13 22:46:35

这很简单。我刚刚完成了这个,它的工作方式与点击复仇加载屏幕完全相同。

要在显示主菜单之前依次加载 2 个不同的屏幕,请执行以下操作。
1)创建一个 nib 文件,放置一个覆盖整个屏幕的 UIButton,然后将其连接到插座。
2)在 viewDidLoad 方法中,我确保 UIButton 的图像背景属性设置为 image1,然后在 1.5 秒后使用计时器将其更改为 image2。

现在,点击复仇加载屏幕允许您通过点击屏幕来跳过这两个加载屏幕。所以基本上创建一个函数,以便当用户点击屏幕(本质上是一个覆盖屏幕宽度和高度的巨大按钮)时,它会将 UIButtons 图像背景属性更改为 image2。如果再次单击,它将为主菜单加载一个新的 nib 文件。瞧,工作完成了。

因此,无论哪种方式,如果您不点击屏幕(uibutton),那么由于计时器,应用程序将显示 image1,然后在 1.5 秒后自动将 UIButton 的图像更改为 image2,然后在另外 1.5 秒(总共 3 秒)后再次将应用程序更改为 image2将加载 mainMenuView nib 文件。

显然,当您单击按钮一次时,它应该更改为 image2,但是当调用相同的函数时如何使图像更改为 image2:
好吧,我有一个计数器,当调用该函数时,该计数器会增加 1。
所以在启动时该值将为 0。因此,当用户点击按钮快速浏览加载屏幕时,该值将更改为 1,并且图像将更改为 image2。

当用户再次单击按钮从 image2 跳到加载屏幕时,将调用相同的函数来更改图像,但会检查计数器以查看其值是否为 1,如果是,则它已经在 image2 上,因此然后加载屏幕。
就这么简单。它运作得很好。
如果有更简单的方法来做到这一点,请告诉我。谢谢

PK

its very simple. i've just accomplished this and it works exactly the same way that the tap tap revenge loading screen does.

To load 2 different screens one after another before showing the main menu you do this.
1) create a nib file place a UIButton that covers the whole screen then connect it to an outlet.
2) in the viewDidLoad method i made sure that the UIButton's image background property was set to image1 then after 1.5 seconds change it to image2 with a timer.

now the tap tap revenge loading screen allows you to skip those two loading screens by tapping on the screen. so basically create a function so that when the user taps on the screen (which essentially is a huge button that covers the width and height of the screen) it would change to UIButtons image background property to image2. If clicked again it would load a new nib file for the main menu. voila job done.

so either way if you dont tap on the screen (the uibutton) then because of the timer the application will show image1, then change the UIButton's image automatically to image2 after 1.5 seconds then again after another 1.5 seconds (3 seconds in total) the application would load the mainMenuView nib file.

obviously when you click the button once it should change to image2 but then how do you get the image to change to image2 when the same function is called:
well i have a counter which will incremement in 1 when the function is called.
so at startup that value would be 0. so when the user taps on the button to quikly skim past the loading screen the value would change to 1 and the image would change to image2.

when the user clicks on the button again to skip from image2 to the loading screen the same function would be called that changes the image but would check the counter to see if it is in value 1 and if it is then that its already on image2 so then just load the screen.
its as simple as that. it works very well.
If there is an easier way to do this do let me know. thanks

Pk

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