Instance Method インスタンスメソッド

offset(_:)

Changes the relative position of this shape using the specified size. この形状の相対位置をこの指定された大きさを使って変更します。

Declaration 宣言

func offset(_ offset: CGSize) -> OffsetShape<Self>

Return Value 戻り値

A shape offset by the specified amount. 指定量だけ位置埋め合わせされた形状。

Parameters パラメータ

offset

The amount, in points, by which you offset the shape. Negative numbers are to the left and up; positive numbers are to the right and down. 分量、ポイントで、それだけあなたは形状を位置埋め合わせします。負の数は左および上の方にします;正の数は右および下の方にします。

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. 以下の例は、2つの円を描出します。それは1つ目の円をそれの省略時の位置に置きます。2つの目の円はあるストロークで輪郭を描かれます、最初の円の上部に置かれます、そして100ポイント左にそして50ポイント下に補われます。


Circle()
.overlay(
    Circle()
    .offset(CGSize(width: -100, height: 50))
    .stroke()
)

See Also 参照

Transforming a Shape