Skip to main content

Rectangle

Rectangle

A representation of a Rectangle shape.


Constructor

public Rectangle

new Rectangle(transform)

Constructor for Rectangle.

Parameters

  •  transform: Transform – Transform spatial information.

new Rectangle(pos, size)

Constructor for Rectangle.

Parameters

  •  pos: Vector – Position.

  •  size: Vector – Dimensions.


Properties

No publicly accessible properties on Rectangle

protected pos: Vector

Description needed

protected size: Vector

Description needed


Methods

public draw

draw(ctx) => void

Draws the Rectangle on the canvas.

Parameters

  •  ctx: CanvasRenderingContext2D – Provides the 2D rendering context for the drawing surface of an element.

Static Methods

No static methods for Rectangle