我正在创建一个游戏,我需要根据级别(背景图像)在(SKNodes)中绘制一些障碍。 假设我有一棵树,我想在它周围绘制边框,如下图所示:
我需要坐标来创建物理主体。
有没有简单的方法呢? (也许是一个软件?)
我需要为不同的设备调整相同的坐标,因此我认为手动执行此操作太复杂。
有什么想法吗?
谢谢!
最佳答案
有一个 SKPhysicsBody 类方法可以提供帮助:
来自描述:
Use this method when your sprite has a shape that you want replicated in its physics body. The texture is scaled to the new size and then analyzed. A new physics body is created that includes all of the texels in the texture that have a nonzero alpha value. The shape of this body attempts to strike a good balance between performance and accuracy. For example, fine details may be ignored if keeping them would cause a significant performance penalty.
关于ios - 有没有一种简单的方法可以从图像中绘制 SKnodes 障碍物的坐标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30097053/