---
title: "init(path:centered:)"
framework: spritekit
role: symbol
role_heading: Initializer
path: "spritekit/skshapenode/init(path:centered:)"
---

# init(path:centered:)

Creates a shape node from a Core Graphics path, centered around its position.

## Declaration

```swift
convenience init(path: CGPath, centered: Bool)
```

## Parameters

- `path`: The Core Graphics path to use.
- `centered`: If doc://com.apple.documentation/documentation/Swift/true, the path is translated so that the center of the path’s bounding box is at the node’s origin; otherwise the path is relative to the node’s origin.

## Return Value

Return Value A new shape node.

## See Also

### Creating a Shape from a Path

- [init(path:)](spritekit/skshapenode/init(path:).md)
- [path](spritekit/skshapenode/path.md)
