<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKShapeNode/init(path:centered:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKShapeNode(cm)shapeNodeWithPath:centered:"
  },
  "title" : "init(path:centered:)"
}
-->

# init(path:centered:)

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

```
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

A new shape node.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)