class Shape
Description:
Shape class is used to create shapes to be drawn in the background of Window or Panel. This class is usually extended by other shapes. It can be used by itself only if path argument is provided.
Path of the shape can be generated by adding, subtracting, or intersecting two shapes, then convert the Shape to JSON object using shape.toObject(). Then resulting object will have path property.
Check out all the shapes that derive from this Shape class: Arc, Ellipse, Line, Polygon, Polyline, Rectangle, and Text that can draw text as a shape.
Constructor
constructor([path], [stroke], [background], [opacity=1], [x=0], [y=0])
Shape constructor.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
|
|
string |
Path consisting of points. It can be auto-generated by performing operations of one shape to another, such as add() or subtract(). |
|
|
|
A border of the shape. |
||
|
|
string |
Color, gradient, image, and background options like in CSS. |
|
|
|
number |
1 |
Opacity of the shape as a decimal between 0 and 1. |
|
|
number |
0 |
Position of the shape from left edge. |
|
|
number |
0 |
Position of the shape from the top. |
Members
- [ readonly ] parent
