Fork me on GitHub
View source

package haxepunk.math

class Rectangle

Constructor

View source

new (x : Float = 0, y : Float = 0, width : Float = 0, height : Float = 0) : Void

Variables

bottom : Float

The bottom-most y-axis value. When set it will push the y value, keeping the same height.

height : Float

left : Float

The left-most x-axis value. Identical to x.

right : Float

The right-most x-axis value. When set it will push the x value, keeping the same width.

top : Float

The top-most y-axis value. Identical to y.

width : Float

x : Float

y : Float

Functions

View source

intersection (other : Rectangle) : Null<Rectangle>

If the rectangle intersects another rectangle, it returns an overlapping rectangle. Otherwise, it returns null.

View source

intersects (other : Rectangle) : Bool

Checks if the rectangle intersects another rectangle.

View source

isEmpty () : Bool

Checks if the rectangle width and height values are at or less than zero.

View source

setTo (x : Float = 0, y : Float = 0, width : Float = 0, height : Float = 0) : Void