springroll.native.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

springroll.native.Rectangle

(
  • x
  • y
  • width
  • height
)

Parameters:

  • x Number

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

  • y Number

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

  • width Number

    The overall width of this rectangle

  • height Number

    The overall height of this rectangle

Methods

Properties

clone

() Rectangle

Defined in clone:51

Creates a clone of this Rectangle

Returns:

Rectangle:

a copy of the rectangle

contains

(
  • x
  • y
)
Boolean

Defined in contains:62

Checks if the x, and y coords passed to this function are contained within this Rectangle

Parameters:

  • x Number

    The X coord of the point to test

  • y Number

    The Y coord of the point to test

Returns:

Boolean:

if the x/y coords are within this Rectangle

height

Number

Defined in height:41

Default: 0

width

Number

Defined in width:34

Default: 0

x

Number

Defined in x:20

Default: 0

y

Number

Defined in y:27

Default: 0