SpriteKit - SKScene 边界不等于 SKView 边界 [英] SpriteKit - SKScene bounds are not equal to SKView bounds

查看:26
本文介绍了SpriteKit - SKScene 边界不等于 SKView 边界的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我创建了一个新的 Xcode - 游戏项目.我没有接触任何东西就运行了模板.我期待一个标准的 Hello World! 应用程序,但我注意到了一件事.我在顶部和底部得到了场景cut,而不是漂亮的背景.

Recently I've created a new Xcode - Game project. Without touching anything I ran the template. I was expecting a standard Hello World! app, but I noticed one thing. Instead of pretty filled background, I got scene cut at the top and the bottom.

如何让它填满整个屏幕?

How can I make it fill the whole screen?

推荐答案

看起来默认的 SpriteKit 游戏模板缺少启动屏幕.您需要手动添加:

It looks like the default SpriteKit Game template is missing a Launch Screen. You need to add it manually:

  1. 添加启动屏幕:

新建文件->iOS->用户界面 ->启动屏幕

New File -> iOS -> User Interface -> Launch Screen

  1. 将新启动屏幕的名称设置为:

[你的项目] ->一般->启动屏幕文件

[Your Project] -> General -> Launch Screen File

这篇关于SpriteKit - SKScene 边界不等于 SKView 边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆