如何删除Swift/Xcode中的物理体大纲

时间:2023-01-23 00:09:09

In the game I am working on, several objects have physics bodies used for collision detection. When I run the game on my iPhone, these bodies are indicated by outlining each object with a bright green or blue line. Is there any way I can remove this? Is this only present when testing apps? I am using Swift and iOS 8.

在我正在开发的游戏中,有几个物体有用于碰撞检测的物理物体。当我在我的iPhone上运行这个游戏时,这些身体通过用一条亮绿色或蓝色的线勾勒出每个物体的轮廓来表示。有什么办法可以去掉这个吗?这是在测试应用程序时才出现的吗?我正在使用Swift和ios8。

1 个解决方案

#1


1  

At some point you're enabling the showsPhysics property of your SKView. Should look something like this:

在某种程度上,您正在启用SKView的showsPhysics属性。应该是这样的:

skView.showsPhysics = true

This property defaults to false, so removing the line of code enabling it will be enough to disable the behavior.

此属性默认为false,因此删除启用该属性的代码行就足以禁用该行为。

#1


1  

At some point you're enabling the showsPhysics property of your SKView. Should look something like this:

在某种程度上,您正在启用SKView的showsPhysics属性。应该是这样的:

skView.showsPhysics = true

This property defaults to false, so removing the line of code enabling it will be enough to disable the behavior.

此属性默认为false,因此删除启用该属性的代码行就足以禁用该行为。