Type Method

bodyWithRectangleOfSize:center:

Creates a rectangular physics body centered on an arbitrary point.

Declaration

+ (SKPhysicsBody *)bodyWithRectangleOfSize:(CGSize)s center:(CGPoint)center;

Parameters

s

The size of the rectangle.

center

The center of the square in the owning node’s coordinate system.

Return Value

A new volume-based physics body.

See Also

Creating a Body from a Shape

+ bodyWithCircleOfRadius:

Creates a circular physics body centered on the owning node’s origin.

+ bodyWithCircleOfRadius:center:

Creates a circular physics body centered on an arbitrary point.

+ bodyWithRectangleOfSize:

Creates a rectangular physics body centered on the owning node’s origin.

+ bodyWithPolygonFromPath:

Creates a polygonal physics body.