# 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. |
# fromObject
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.
# origin
Two.Rectangle.origin
A two-component vector describing the origin offset to draw the rectangle. Default is 0, 0.
# copy
Two.Rectangle.copy
| Argument | Description |
|---|---|
| rectangle | The reference Two.Rectangle |
Copy the properties of one Two.Rectangle onto another.
# clone
Two.Rectangle.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
Two.Rectangle.toObject
Returns: Object
Return a JSON compatible plain object that represents the path.
← Two.Line Two.Ellipse →