Rectangle

Rectangle

Methods


rectangle_clone(rectangle)


Returns a new rectangle with the same x, y, width, and height properties of the original.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
rectangle

rectangle to clone

Code Equivalent:
rectangle.clone()

rectangle_contains(rectangle, x, y)


Returns true/false if the rectangle contains the given coordinates.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
rectangle

rectangle to check

x Number

x coordinate to check

y Number

y coordinate to check

Code Equivalent:
Phaser.Rectangle.contains(rectangle, x, y)

rectangle_contains_point(rectangle, point)


Returns true/false if the rectangle contains the point.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
rectangle

rectangle to check

point

point to check

Code Equivalent:
Phaser.Rectangle.containsPoint(rectangle, point)

rectangle_contains_rect(rectangle_a, rectangle_b)


Returns true/false if one rectangle is fulling contained within another.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
rectangle_a

the first rectangle to check

rectangle_b

the second rectangle to check

Code Equivalent:
Phaser.Rectangle.containsRect(rectangle_a, rectangle_b)

rectangle_create(x, y, width, height)

Parameters:
Name Type Description
x Number

x coordinate for the new rectangle

y Number

y coordinate for the new rectangle

width Number

width of the rectangle

height Number

height of the rectangle

Code Equivalent:
new Phaser.Rectangle(x, y, width, height)

rectangle_get_numeric_field(object, field)


Returns the chosen numeric field value of the rectangle.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to get values from

field

the field to get values of

Code Equivalent:
Phaser.Rectangle.intersects(rectA, rectB)

rectangle_get_point_field(object, field)


Returns the chosen point field value of the rectangle.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to get values from

field

the field to get values of

Code Equivalent:
object.field

rectangle_intersects(rectA, rectB)


Returns true/false if the two rectangles intersect.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
rectA

first rectangle to check

rectB

second rectangle to check

Code Equivalent:
Phaser.Rectangle.intersects(rectA, rectB)

rectangle_random(rectangle)


Returns a random x/y coordinate point from the rectangle.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
rectangle

rectangle to get values from

Code Equivalent:
rectangle.random()

rectangle_set_numeric_field(object, field, value)


Assign the chosen numeric field of the rectangle.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to set the value for

field

the field to set

value Number

value to set the field to

Code Equivalent:
object.field = value;

rectangle_set_point_field(object, field, point)


Assign the chosen point field of the rectangle.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to set the point for

field

the field to set

point

point to set the field to

Code Equivalent:
object.field = value;