Skip to main content

Rectangle

Rectangle

Kind: global class

new Rectangle(x, y, width, height)

ParamTypeDefault
xnumber0
ynumber0
widthnumber0
heightnumber0

rectangle.position : Vector2

Kind: instance property of Rectangle
Read only: true

rectangle.size : Vector2

Kind: instance property of Rectangle
Read only: true

rectangle.x0 ⇒ number

Kind: instance property of Rectangle

rectangle.x1 ⇒ number

Kind: instance property of Rectangle

rectangle.y0 ⇒ number

Kind: instance property of Rectangle

rectangle.y1 ⇒ number

Kind: instance property of Rectangle

rectangle.isRectangle : boolean

Kind: instance property of Rectangle
Read only: true

rectangle.set(x, y, width, height)

Kind: instance method of Rectangle

ParamType
xnumber
ynumber
widthnumber
heightnumber

rectangle.clone() ⇒ Rectangle

Kind: instance method of Rectangle

rectangle.copy(other)

Kind: instance method of Rectangle

ParamType
otherRectangle

rectangle._intersects(x0, y0, x1, y1) ⇒ boolean

Kind: instance method of Rectangle

ParamType
x0number
y0number
x1number
y1number

rectangle.intersects(other) ⇒ boolean

Kind: instance method of Rectangle

ParamType
otherRectangle

rectangle._overlaps(x0, y0, x1, y1) ⇒ boolean

Kind: instance method of Rectangle

ParamType
x0number
y0number
x1number
y1number

rectangle.overlaps(other) ⇒ boolean

Kind: instance method of Rectangle

ParamType
otherRectangle

rectangle._resizeToFit(x0, y0, x1, y1)

Kind: instance method of Rectangle

ParamType
x0number
y0number
x1number
y1number

rectangle.resizeToFit(other)

Kind: instance method of Rectangle

ParamType
otherRectangle

rectangle._contains(x0, y0, x1, y1) ⇒ boolean

Kind: instance method of Rectangle

ParamType
x0number
y0number
x1number
y1number

rectangle.contains(other) ⇒ boolean

Kind: instance method of Rectangle

ParamType
otherRectangle

rectangle.computeCenter(result)

Kind: instance method of Rectangle

ParamType
resultVector2

rectangle.computeArea() ⇒ number

Kind: instance method of Rectangle

rectangle.toArray(target, [targetOffset])

Kind: instance method of Rectangle

ParamTypeDefault
targetArray.<number> | Float32Array | Float64Array | Uint8Array
[targetOffset]number0