我正在使用带有图像的 SKTexture 并设置SKPhysicsBody
. 像那样:
var moleTexture = SKTexture(imageNamed: "moleTop1")
leftPlayer = SKSpriteNode(texture: moleTexture)
leftPlayer.physicsBody = SKPhysicsBody(texture: moleTexture, size: leftPlayer.texture!.size())
现在开始游戏后,我注意到physicsBody 设置错误。我已激活该showPhysics
属性,我的图像如下所示:
如您所见,唯一使用的SKPhysicsBody
是左中角的小部分(蓝色边框)。
如何更改它以便使用整个图像?