API Docs for: 2.2.1
Show:

Rectangle Class

the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

Constructor

Rectangle

(
  • x
  • y
  • width
  • height
)

Parameters:

  • x Float

    The X coord of the upper-left corner of the rectangle

  • y Float

    The Y coord of the upper-left corner of the rectangle

  • width Float

    The overall width of this rectangle

  • height Float

    The overall height of this rectangle

Item Index

Methods

Properties

Methods

clone

() Rectangle

Creates a clone of this Rectangle instance

Returns:

Rectangle:

a copy of the rectangle

contains

(
  • x
  • y
)
Bool

Checks whether the x and y coordinates passed to this function are contained within this Rectangle

Parameters:

  • x Float

    The X coordinate of the point to test

  • y Float

    The Y coordinate of the point to test

Returns:

Bool:

Whether the x/y coords are within this Rectangle

Properties

height

Float

Default: 0

width

Float

Default: 0

x

Float

Default: 0

y

Float

Default: 0