Rect


super: Object

Represents a rectangle.

Properties

  • var x: Float Rect origin x coordinate.

  • var y: Float Rect origin y coordinate.

  • var width: Float Rect width size value.

  • var height: Float Rect height size value.

  • var objectName: String The name of the object.

Constructors

Methods

  • func copy(): Rect Copy a Rect object by value (duplicate).

  • func rectWithInset(point: Point): Rect Create a new Rect object with the specified inset.

  • func rectWithOffset(point: Point): Rect Create a new Rect object with the specified offset

  • func rectByUnion(rect: Rect): Rect Create a new Rect object by performing the union operation between two specified Rect objects.

  • func rectByIntersection(rect: Rect): Rect Create a new Rect object by performing intersection between two specified Rect objects.

  • func containsPoint(point: Point): Bool Check if it contains a specified Point.

  • func containsRect(rect: Rect): Bool Check if it contains a specified Rect.

  • func intersectsRect(rect: Rect): Bool Returns whether two rectangles intersect.

  • func minX(): Float Returns the smallest value for the x-coordinate of the rectangle.

  • func maxX(): Float Returns the largest value of the x-coordinate for the rectangle.

  • func minY(): Float Returns the smallest value for the y-coordinate of the rectangle.

  • func maxY(): Float Returns the largest value for the y-coordinate of the rectangle.

  • func midX(): Float Returns the x- coordinate that establishes the center of a rectangle.

  • func midY(): Float Returns the y-coordinate that establishes the center of the rectangle.