RectangleType

public protocol RectangleType : GeometricType

Protocol for geometric types defined by vectors that fill enclosed rectangular areas with a defined location and size.

  • The vector type associated with this RectangleType.

    Declaration

    Swift

    associatedtype Vector : VectorType
  • The starting location of this rectangle with the minimal coordinates contained within the rectangle.

    Declaration

    Swift

    var location: Vector { get }
  • The size of this rectangle, which when added to location produce the maximal coordinates contained within this rectangle.

    Declaration

    Swift

    var size: Vector { get }

Available where Vector: Vector2Type

  • x Extension method

    Gets the X position of this Rectangle.

    Declaration

    Swift

    var x: Vector.Scalar { get }
  • y Extension method

    Gets the Y position of this Rectangle.

    Declaration

    Swift

    var y: Vector.Scalar { get }
  • width Extension method

    Gets the width of this Rectangle.

    Declaration

    Swift

    var width: Vector.Scalar { get }
  • height Extension method

    Gets the height of this Rectangle.

    Declaration

    Swift

    var height: Vector.Scalar { get }
  • top Extension method

    The y coordinate of the top corner of this rectangle.

    Alias for y.

    Declaration

    Swift

    var top: Vector.Scalar { get }
  • left Extension method

    The x coordinate of the left corner of this rectangle.

    Alias for x.

    Declaration

    Swift

    var left: Vector.Scalar { get }
  • topLeft Extension method

    The top-left corner of the rectangle.

    Declaration

    Swift

    var topLeft: Vector { get }