Physicsbody doesn't adhere to node's anchor point

前端 未结 7 1226
陌清茗
陌清茗 2020-12-09 15:09

My scene has a bunch of rectangles with physics bodies that are the same size as the rectangle. I like to anchor all of my objects to CGPointZero, however I\'ve noticed when

7条回答
  •  既然无缘
    2020-12-09 15:37

    You need the anchorPoint only when you set your spriteNode's position. I don't quite understand why would you need to move physicsBody (which is the same size of node, I presume) to a corner... But you might find useful this class method [SKPhysicsBody bodyWithPolygonFromPath:path].

    Here is a nice generator for that: http://dazchong.com/spritekit/

提交回复
热议问题