Methods
(async) activate(where)
Called when the brush is first activated (by a click).
Parameters:
Name | Type | Description |
---|---|---|
where |
Vector3 | where on the screen the brush was activated |
- Source:
decrement()
Called when the user tries to "decrement" the brush; may scroll through brush options, etc.
- Source:
displayButton(button)
Modify the given button's text, title, etc. to represent the brush.
Parameters:
Name | Type | Description |
---|---|---|
button |
Element | the HTML button to modify |
- Source:
displaySidebar(brushBar, container)
Modify the given brushbar to display options, information, or other controls for this brush.
Parameters:
Name | Type | Description |
---|---|---|
brushBar |
BrushBar | the being used |
container |
Element | the actual HTML to add elements to; will typically be displayed within the brushbar |
- Source:
(async) draw(context, position)
Draw the brush on a canvas at a given position.
Parameters:
Name | Type | Description |
---|---|---|
context |
CanvasRenderingContext2D | the canvas context to draw on |
position |
Vector3 | the center of where the brush should be drawn |
- Source:
(async) drawAsCircle(context, position)
Draw the brush as a circle with generic information on a canvas.
Parameters:
Name | Type | Description |
---|---|---|
context |
CanvasRenderingContext2D | the canvas context to draw on |
position |
Vector3 | the center of where the brush should be drawn |
- Source:
enlarge()
Called when the user tries to enlarge the size of the brush.
- Source:
getDescription()
Get a human-readable description of the brush, indicating what options are being used.
- Source:
getRadius()
Get the radius, in pixels, of the brush as currently displayed.
- Source:
increment()
Called when the user tries to "increment" the brush; may scroll through brush options, etc.
- Source:
shrink()
Called when the user tries to shrink the size of the brush.
- Source:
signalLayerChange()
Called when the brush's context's current layer changes.
- Source:
sizeInMeters()
Get the radius, in meters, of the brush as currently displayed.
- Source:
sizeRecentlyChanged() → {boolean}
Has the size of the brush been recently changed?
- Source:
Returns:
- Type
- boolean
switchTo()
Called when the brush is switched to from another brush.
- Source:
(async) trigger(where, mouseDragEvent)
Called when the brush is triggered during a mouse drag event.
Mouse drag events may trigger the brush every time the mouse moves across the screen while bring held down.
Parameters:
Name | Type | Description |
---|---|---|
where |
Vector3 | where on the screen the brush is at this point |
mouseDragEvent |
DragEvent | the ongoing mouse drag event |
- Source: