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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software