Methods
dpi() → {number}
Get the dpi of the Linen instance
Returns:
dpi
- Type
- number
width() → {number}
Get the width of the element
Returns:
px
- Type
- number
height() → {number}
Get the height of the element
Returns:
px
- Type
- number
x() → {number}
Get the x positioning of the element with reference point considered.
Returns:
px
- Type
- number
y() → {number}
Get the y positioning of the element with reference point considered.
Returns:
px
- Type
- number
setWidth(val) → {self}
Set the width of the element
Parameters:
Name | Type | Description |
---|---|---|
val |
number | width |
Returns:
self
- Type
- self
setHeight(val) → {self}
Set the height of the element
Parameters:
Name | Type | Description |
---|---|---|
val |
number | height |
Returns:
self
- Type
- self
setX(val) → {self}
Set the x positioning of the element
Parameters:
Name | Type | Description |
---|---|---|
val |
number | x positioning |
Returns:
self
- Type
- self
setY(val) → {self}
Set the y positioning of the element
Parameters:
Name | Type | Description |
---|---|---|
val |
number | y positioning |
Returns:
self
- Type
- self
setXY(x, y) → {self}
Shorthand to set the x and y positioning of the element
Parameters:
Name | Type | Description |
---|---|---|
x |
number | x positioning |
y |
number | y positioning |
Returns:
self
- Type
- self
setAlignment(alignmentopt) → {self}
Set the x reference point for positioning
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
alignment |
'left' | 'center' | 'right' |
<optional> |
left
|
left|center|right |
Returns:
self
- Type
- self
center() → {self}
Shorthand to set the reference point for positioning to center
Returns:
self
- Type
- self
setVAlignment(v_alignmentopt) → {self}
Set the y reference point for positioning
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
v_alignment |
'top' | 'middle' | 'bottom' |
<optional> |
top
|
top|middle|bottom |
Returns:
self
- Type
- self
middle() → {self}
Shorthand to set the y reference point for positioning to bottom
Returns:
self
- Type
- self
setTransorm(a, b, c, d, e, f) → {self}
Set the transform to be used on
Parameters:
Name | Type | Default | Description |
---|---|---|---|
a |
type |
1
|
Horizontal scaling. A value of 1 results in no scaling. |
b |
type |
0
|
Vertical skewing. |
c |
type |
0
|
Horizontal skewing. |
d |
type |
1
|
Vertical scaling. A value of 1 results in no scaling. |
e |
type |
0
|
Horizontal translation (moving). |
f |
type |
0
|
Vertical translation (moving). |
Returns:
self
- Type
- self
setFill(bool) → {self}
Enable or disable rendering the fill
Parameters:
Name | Type | Default | Description |
---|---|---|---|
bool |
bool |
true
|
TRUE|FALSE |
Returns:
self
- Type
- self
setStroke(bool) → {self}
Enable or disable rendering the stroke
Parameters:
Name | Type | Default | Description |
---|---|---|---|
bool |
bool |
true
|
TRUE|FALSE |
Returns:
self
- Type
- self
setClip(bool) → {self}
Enable or disable using the path as a clipping mask.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
bool |
bool |
true
|
TRUE|FALSE |
Returns:
self
- Type
- self
setDimension(dimension, value) → {self}
Set the value of a given dimension.
Parameters:
Name | Type | Description |
---|---|---|
dimension |
string | dimension name. |
value |
* | mixed value |
Returns:
self
- Type
- self
getSetting(setting) → {string}
Get the value of a given setting.
Parameters:
Name | Type | Description |
---|---|---|
setting |
string | setting name. |
Returns:
value
- Type
- string
setSetting(setting, value) → {self}
Set the value of a given setting.
Parameters:
Name | Type | Description |
---|---|---|
setting |
string | setting name. |
value |
* | mixed value |
Returns:
self
- Type
- self
setProp(prop, value) → {self}
Set the value of a given property. This should probably not be used directly.
Parameters:
Name | Type | Description |
---|---|---|
prop |
string | property name. |
value |
* | mixed value |
Returns:
self
- Type
- self
setFillStyle(fillStyle) → {self}
Set the fillStyle to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
fillStyle |
string | color|gradient|pattern |
Returns:
self
- Type
- self
setFilter(filter) → {self}
Set the filter to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
filter |
string | none | blur() | brightness() | contrast() | drop-shadow() | grayscale() | hue-rotate() | invert() | opacity() | saturate() | sepia() | url(); |
Returns:
self
- Type
- self
setGlobalAlpha(globalAlpha) → {self}
Set the globalAlpha to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
globalAlpha |
float | 1 being completely opaque and 0 being completely transparent |
Returns:
self
- Type
- self
setLineCap(lineCap) → {self}
Set the lineCap to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
lineCap |
string | butt|round|square |
Returns:
self
- Type
- self
setLineJoin(lineJoin) → {self}
Set the lineJoin to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
lineJoin |
string | bevel|round|miter |
Returns:
self
- Type
- self
setLineWidth(lineWidth) → {self}
Set the lineWidth to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
lineWidth |
* | size in px, pt, inches (in), or percentage (%) |
Returns:
self
- Type
- self
setMiterLimit(miterLimit) → {self}
Set the miterLimit to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
miterLimit |
number | A positive number that specifies the maximum miter length. |
Returns:
self
- Type
- self
setShadowBlur(shadowBlur) → {self}
Set the shadowBlur to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
shadowBlur |
number | The blur level for the shadow. |
Returns:
self
- Type
- self
setShadowColor(shadowColor) → {self}
Set the shadowColor to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
shadowColor |
string | color|gradient|pattern |
Returns:
self
- Type
- self
setShadowOffsetX(shadowOffsetX) → {self}
Set the shadowOffsetX to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
shadowOffsetX |
number | A positive or negative number that defines the horizontal distance of the shadow from the shape. |
Returns:
self
- Type
- self
setShadowOffsetY(shadowOffsetY) → {self}
Set the shadowOffsetY to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
shadowOffsetY |
number | A positive or negative number that defines the vertical distance of the shadow from the shape. |
Returns:
self
- Type
- self
setStrokeStyle(strokeStyle) → {self}
Set the strokeStyle to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
strokeStyle |
string | color|gradient|pattern |
Returns:
self
- Type
- self
setTextAlign(textAlign) → {self}
Set the textAlign to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
textAlign |
string | center|end|left|right|start |
Returns:
self
- Type
- self
setTextBaseline(textBaseline) → {self}
Set the textBaseline to be used for rendering.
Parameters:
Name | Type | Description |
---|---|---|
textBaseline |
string | alphabetic|top|hanging|middle|ideographic|bottom |
Returns:
self
- Type
- self
setCallback(callback) → {self}
Add a callback for when the afterRender() in ran.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
Returns:
self
- Type
- self