Anchor2D

public struct Anchor2D : Hashable

Represents a point in a rectangle as a ratio of this rectangle’s width and height.

  • Defines the x axis where the left is 0, the right is 1 and the middle is 0.5. The default value is 0.5.

    Declaration

    Swift

    public var horizontal: Double
  • Defines the y axis where the top is 0, the bottom is 1 and the middle is 0.5. The default value is 0.5.

    Declaration

    Swift

    public var vertical: Double
  • Creates a new instance of an Anchor2D with the default parameters

    Declaration

    Swift

    public init()
  • Creates a new instance of an Anchor2D.

    Declaration

    Swift

    public init(horizontal: Double, vertical: Double)

    Parameters

    horizontal

    Defines the x axis where the left is 0, the right is 1 and the middle is 0.5.

    vertical

    Defines the y axis where the top is 0, the bottom is 1 and the middle is 0.5.