---
title: "offset(x:y:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/shape/offset(x:y:)"
---

# offset(x:y:)

Changes the relative position of this shape using the specified point.

## Declaration

```swift
nonisolated func offset(x: CGFloat = 0, y: CGFloat = 0) -> OffsetShape<Self>
```

## Parameters

- `x`: The horizontal amount, in points, by which you offset the shape. Negative numbers are to the left and positive numbers are to the right.
- `y`: The vertical amount, in points, by which you offset the shape. Negative numbers are up and positive numbers are down.

## Return Value

Return Value A shape offset by the specified amount.

## Discussion

Discussion The following example renders two circles. It places one circle at its default position. The second circle is outlined with a stroke, positioned on top of the first circle and offset by 100 points to the left and 50 points below. Circle() .overlay(     Circle()     .offset(x: -100, y: 50)     .stroke() )

## See Also

### Transforming a shape

- [trim(from:to:)](swiftui/shape/trim(from:to:).md)
- [transform(_:)](swiftui/shape/transform(_:).md)
- [size(_:)](swiftui/shape/size(_:).md)
- [size(width:height:)](swiftui/shape/size(width:height:).md)
- [scale(_:anchor:)](swiftui/shape/scale(_:anchor:).md)
- [scale(x:y:anchor:)](swiftui/shape/scale(x:y:anchor:).md)
- [rotation(_:anchor:)](swiftui/shape/rotation(_:anchor:).md)
- [offset(_:)](swiftui/shape/offset(_:).md)
