SprayBrush
Defined in: src/brushes/SprayBrush.ts:31
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SprayBrush(
canvas
):SprayBrush
Defined in: src/brushes/SprayBrush.ts:77
Constructor
Parameters
Section titled “Parameters”canvas
Section titled “canvas”Returns
Section titled “Returns”SprayBrush
Instance of a spray brush
Overrides
Section titled “Overrides”Properties
Section titled “Properties”canvas
Section titled “canvas”canvas:
Canvas
Defined in: src/brushes/BaseBrush.ts:66
add type
Inherited from
Section titled “Inherited from”color:
string
='rgb(0, 0, 0)'
Defined in: src/brushes/BaseBrush.ts:15
Color of a brush
Inherited from
Section titled “Inherited from”density
Section titled “density”density:
number
=20
Defined in: src/brushes/SprayBrush.ts:42
Density of a spray (number of dots per chunk)
dotWidth
Section titled “dotWidth”dotWidth:
number
=1
Defined in: src/brushes/SprayBrush.ts:48
Width of spray dots
dotWidthVariance
Section titled “dotWidthVariance”dotWidthVariance:
number
=1
Defined in: src/brushes/SprayBrush.ts:54
Width variance of spray dots
limitedToCanvasSize
Section titled “limitedToCanvasSize”limitedToCanvasSize:
boolean
=false
Defined in: src/brushes/BaseBrush.ts:61
When true
, the free drawing is limited to the whiteboard size. Default to false.
Default
Section titled “Default”false
Inherited from
Section titled “Inherited from”optimizeOverlapping
Section titled “optimizeOverlapping”optimizeOverlapping:
boolean
=true
Defined in: src/brushes/SprayBrush.ts:66
Whether overlapping dots (rectangles) should be removed (for performance reasons)
randomOpacity
Section titled “randomOpacity”randomOpacity:
boolean
=false
Defined in: src/brushes/SprayBrush.ts:60
Whether opacity of a dot should be random
shadow
Section titled “shadow”shadow:
null
|Shadow
=null
Defined in: src/brushes/BaseBrush.ts:29
Shadow object representing shadow of this shape. Backwards incompatibility note: This property replaces “shadowColor” (String), “shadowOffsetX” (Number), “shadowOffsetY” (Number) and “shadowBlur” (Number) since v1.2.12
Inherited from
Section titled “Inherited from”strokeDashArray
Section titled “strokeDashArray”strokeDashArray:
null
|number
[] =null
Defined in: src/brushes/BaseBrush.ts:53
Stroke Dash Array.
Inherited from
Section titled “Inherited from”strokeLineCap
Section titled “strokeLineCap”strokeLineCap:
CanvasLineCap
='round'
Defined in: src/brushes/BaseBrush.ts:35
Line endings style of a brush (one of “butt”, “round”, “square”)
Inherited from
Section titled “Inherited from”strokeLineJoin
Section titled “strokeLineJoin”strokeLineJoin:
CanvasLineJoin
='round'
Defined in: src/brushes/BaseBrush.ts:41
Corner style of a brush (one of “bevel”, “round”, “miter”)
Inherited from
Section titled “Inherited from”strokeMiterLimit
Section titled “strokeMiterLimit”strokeMiterLimit:
number
=10
Defined in: src/brushes/BaseBrush.ts:47
Maximum miter length (used for strokeLineJoin = “miter”) of a brush’s
Inherited from
Section titled “Inherited from”width:
number
=10
Defined in: src/brushes/SprayBrush.ts:36
Width of a spray
Overrides
Section titled “Overrides”Methods
Section titled “Methods”_render()
Section titled “_render()”_render():
void
Defined in: src/brushes/SprayBrush.ts:171
Render all spray chunks
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”addSprayChunk()
Section titled “addSprayChunk()”addSprayChunk(
pointer
):void
Defined in: src/brushes/SprayBrush.ts:186
Parameters
Section titled “Parameters”pointer
Section titled “pointer”Returns
Section titled “Returns”void
onMouseDown()
Section titled “onMouseDown()”onMouseDown(
pointer
):void
Defined in: src/brushes/SprayBrush.ts:87
Invoked on mouse down
Parameters
Section titled “Parameters”pointer
Section titled “pointer”Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”onMouseMove()
Section titled “onMouseMove()”onMouseMove(
pointer
):void
Defined in: src/brushes/SprayBrush.ts:100
Invoked on mouse move
Parameters
Section titled “Parameters”pointer
Section titled “pointer”Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”onMouseUp()
Section titled “onMouseUp()”onMouseUp():
void
Defined in: src/brushes/SprayBrush.ts:111
Invoked on mouse up
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”renderChunck()
Section titled “renderChunck()”renderChunck(
sprayChunck
):void
Defined in: src/brushes/SprayBrush.ts:153
Parameters
Section titled “Parameters”sprayChunck
Section titled “sprayChunck”Returns
Section titled “Returns”void