1.18.0 • Published 4 years ago
@pencil.js/component v1.18.0
Component
Abstract class for visual component of a scene.
Installation
npm install @pencil.js/component
Examples
import Component from "@pencil.js/component";
class FunnyShape extends Component {
/**
* @override Component.prototype.render
*/
render (ctx) {
// Do crazy stuff here
}
}
ComponentOptions
Inherit from ContainerOptions.
Name | Type | Default | Comment |
---|---|---|---|
fill | Color or String | "#000" | Background Color used to fill, set to null for transparent |
stroke | Color or String | null | Color used to stroke, set to null for transparent |
strokeWidth | Number | 2 | Stroke line thickness in pixels |
cursor | String | Component.cursors.default | Cursor to use when hover |
join | String | Component.joins.miter | How lines join between them |
origin | Position | new Position() | Relative offset |
shadow | ShadowOptions | (see below) | Set of options to set a shadow |
ShadowOptions
Name | Type | Default | Comment |
---|---|---|---|
blur | Number | 0 | Spread of the shadow around the component |
position | Position | new Position() | Position of the shadow relative to the component |
color | Color or String | null | Color of the shadow |
1.18.0
4 years ago
1.17.0
4 years ago
1.16.0
4 years ago
1.15.0
4 years ago
1.14.0
4 years ago
1.13.1
4 years ago
1.13.0
5 years ago
1.12.0
5 years ago
1.11.0
5 years ago
1.10.2
5 years ago
1.10.1
5 years ago
1.10.0
5 years ago
1.9.2
5 years ago
1.9.0
5 years ago
1.8.0
5 years ago
1.7.0
5 years ago
1.6.6
5 years ago
1.6.5
5 years ago
1.6.4
5 years ago
1.6.3
5 years ago
1.6.2
5 years ago
1.6.1
5 years ago
1.6.0
5 years ago
1.5.0
5 years ago
1.4.1
5 years ago
1.4.0
5 years ago
1.3.1
5 years ago
1.2.0
6 years ago
1.1.0
6 years ago
1.0.2
6 years ago
1.0.0
6 years ago
0.9.2
6 years ago
0.9.1
6 years ago
0.8.3
6 years ago
0.8.2
6 years ago
0.8.1
6 years ago
0.8.0
6 years ago
0.7.1
6 years ago
0.7.0
6 years ago
0.6.0
6 years ago
0.5.0
6 years ago
0.4.0
6 years ago
0.3.0
6 years ago
0.2.0
6 years ago