SpriteKit 缩放影响物理

SpriteKit scaling affects physics

我通过重新缩放包含游戏中所有对象的根 "world" 节点来实现缩放。但是,随着世界节点和子节点的尺寸变小,施加力现在会产生更大的效果。

即使我按与我的世界节点相同的比例来缩放力,它们仍然很大并且物体会飞起来。

我看到了一些非常忙碌的解决方案:

是否有更直接的方法来以某种方式使用世界节点缩放物理世界?

是的,不要为了缩放而缩放。请尝试 调整大小

myScene.scaleMode = SKSceneScaleModeAspectFill;

然后在缩放时:

myScene.size = CGSizeMake(myScene.size.width + dx, myScene.size.height + dy);

*Apple Documentation says:

Set the scaleMode property to SKSceneScaleModeResizeFill. Sprite Kit automatically resizes the scene so that it always matches the view’s size.