---
title: "init(rectangleOf:center:)"
framework: spritekit
role: symbol
role_heading: Initializer
path: "spritekit/skphysicsbody/init(rectangleof:center:)"
---

# init(rectangleOf:center:)

Creates a rectangular physics body centered on an arbitrary point.

## Declaration

```swift
init(rectangleOf s: CGSize, center: CGPoint)
```

## Parameters

- `s`: The size of the rectangle.
- `center`: The center of the square in the owning node’s coordinate system.

## Return Value

Return Value A new volume-based physics body.

## See Also

### Creating a Body from a Shape

- [init(circleOfRadius:)](spritekit/skphysicsbody/init(circleofradius:).md)
- [init(circleOfRadius:center:)](spritekit/skphysicsbody/init(circleofradius:center:).md)
- [init(rectangleOf:)](spritekit/skphysicsbody/init(rectangleof:).md)
- [init(polygonFrom:)](spritekit/skphysicsbody/init(polygonfrom:).md)
