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:83
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:73
add type
Inherited from
Section titled “Inherited from”color:
string
='rgb(0, 0, 0)'
Defined in: src/brushes/BaseBrush.ts:16
Color of a brush
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”density
Section titled “density”density:
number
=20
Defined in: src/brushes/SprayBrush.ts:44
Density of a spray (number of dots per chunk)
Default
Section titled “Default”
dotWidth
Section titled “dotWidth”dotWidth:
number
=1
Defined in: src/brushes/SprayBrush.ts:51
Width of spray dots
Default
Section titled “Default”
dotWidthVariance
Section titled “dotWidthVariance”dotWidthVariance:
number
=1
Defined in: src/brushes/SprayBrush.ts:58
Width variance of spray dots
Default
Section titled “Default”
limitedToCanvasSize
Section titled “limitedToCanvasSize”limitedToCanvasSize:
boolean
=false
Defined in: src/brushes/BaseBrush.ts:68
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:72
Whether overlapping dots (rectangles) should be removed (for performance reasons)
Default
Section titled “Default”
randomOpacity
Section titled “randomOpacity”randomOpacity:
boolean
=false
Defined in: src/brushes/SprayBrush.ts:65
Whether opacity of a dot should be random
Default
Section titled “Default”
shadow
Section titled “shadow”shadow:
null
|Shadow
=null
Defined in: src/brushes/BaseBrush.ts:32
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
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”strokeDashArray
Section titled “strokeDashArray”strokeDashArray:
null
|number
[] =null
Defined in: src/brushes/BaseBrush.ts:60
Stroke Dash Array.
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”strokeLineCap
Section titled “strokeLineCap”strokeLineCap:
CanvasLineCap
='round'
Defined in: src/brushes/BaseBrush.ts:39
Line endings style of a brush (one of “butt”, “round”, “square”)
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”strokeLineJoin
Section titled “strokeLineJoin”strokeLineJoin:
CanvasLineJoin
='round'
Defined in: src/brushes/BaseBrush.ts:46
Corner style of a brush (one of “bevel”, “round”, “miter”)
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”strokeMiterLimit
Section titled “strokeMiterLimit”strokeMiterLimit:
number
=10
Defined in: src/brushes/BaseBrush.ts:53
Maximum miter length (used for strokeLineJoin = “miter”) of a brush’s
Default
Section titled “Default”
Inherited from
Section titled “Inherited from”width:
number
=10
Defined in: src/brushes/SprayBrush.ts:37
Width of a spray
Default
Section titled “Default”
Overrides
Section titled “Overrides”Methods
Section titled “Methods”_render()
Section titled “_render()”_render():
void
Defined in: src/brushes/SprayBrush.ts:177
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:192
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:93
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:106
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:117
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:159
Parameters
Section titled “Parameters”sprayChunck
Section titled “sprayChunck”Returns
Section titled “Returns”void