# Two.Rectangle

Extends: Two.Path

# Constructor

Argument Description
x The x position of the rectangle.
y The y position of the rectangle.
width The width value of the rectangle.
height The width value of the rectangle.

# Properties

A list of properties that are on every Two.Rectangle.

# fromObject

Returns: Two.Rectangle

Argument Description
obj Object notation of a Two.Rectangle to create a new instance

Create a new Two.Rectangle from an object notation of a Two.Rectangle.

nota-bene

Works in conjunction with Two.Rectangle.toObject

# width

The size of the width of the rectangle.

# height

The size of the height of the rectangle.

# origin

A two-component vector describing the origin offset to draw the rectangle. Default is 0, 0.

# copy

Argument Description
rectangle The reference Two.Rectangle

Copy the properties of one Two.Rectangle onto another.

# clone

Returns: Two.Rectangle

Argument Description
parent The parent group or scene to add the clone to.

Create a new instance of Two.Rectangle with the same properties of the current path.

# toObject

Returns: Object

Return a JSON compatible plain object that represents the path.