add graphics
Adds a container. A container holds graphics entities. This increases performance because when a property of an asset inside the container is changed, only that container needs to be redrawn. It is also faster to redraw the entities in batches as opposed to having each graphics entity seperate.
Parameter | Type | Description |
---|---|---|
id | String | unique id of the container |
canvas | String | id of the canvas the container should be a part of |
adds a circle
Parameter | Type | Description |
---|---|---|
id | String | id of the circle |
container | String | id of the container |
x | Number | x position of the circle |
y | Number | y position of the circle |
radius | Number | radius of the circle |
color | Hex | color of the circle |
adds a rectangle
Parameter | Type | Description |
---|---|---|
id | String | id of the rectangle |
container | String | id of the container |
x | Number | x position of the rectangle |
y | Number | y position of the rectangle |
width | Number | width of the rectangle |
height | Number | height of the rectangle |
color | Hex | color of the rectangle |
adds a box
Parameter | Type | Description |
---|---|---|
id | String | id of the box |
container | String | id of the container |
x | Number | x position of the box |
y | Number | y position of the box |
width | Number | width of the box |
height | Number | height of the box |
color | Hex | color of the box |
borderRadius | Int | radius of the corners of the box |
adds a line
Parameter | Type | Description |
---|---|---|
id | String | id of the line |
container | String | id of the container |
x1 | Number | x1 position of the line |
y1 | Number | y1 position of the line |
x2 | Number | x2 position of the line |
y2 | Number | y2 position of the line |
color | Hex | color of the line |
adds a ellipse
Parameter | Type | Description |
---|---|---|
id | String | id of the ellipse |
container | String | id of the container |
x | Number | x position of the ellipse |
y | Number | y position of the ellipse |
width | Number | width of the ellipse |
height | Number | height of the ellipse |
color | Hex | color of the ellipse |
adds a torus
Parameter | Type | Description |
---|---|---|
id | String | id of the torus |
container | String | id of the container |
x | Number | x position of the torus |
y | Number | y position of the torus |
width | Number | width of the torus |
height | Number | height of the torus |
color | Hex | color of the torus |
adds a polygon
Parameter | Type | Description |
---|---|---|
id | String | id of the polygon |
container | String | id of the container |
points | [Point] | points of the polygon |
color | Hex | color of the polygon |