ScribbleManager

See source code
Table of contents
class ScribbleManager {}

Constructor

Constructs a new instance of the ScribbleManager class

Parameters

NameDescription

editor


Properties

scribbleItems

scribbleItems: Map<string, ScribbleItem>

state

state: 'paused' | 'running'

Methods

addPoint()

Set the scribble's next point.

addPoint(
  id: ScribbleItem['id'],
  x: number,
  y: number,
  z?: number
): ScribbleItem

Parameters

NameDescription

id

The id of the scribble to add a point to.

x

number

The x coordinate of the point.

y

number

The y coordinate of the point.

z

number

The z coordinate of the point.

Returns


addScribble()

addScribble(scribble: Partial<TLScribble>, id?: string): ScribbleItem

Parameters

NameDescription

scribble

Partial<TLScribble>

id

string

Returns


reset()

reset(): void

stop()

Start stopping the scribble. The scribble won't be removed until its last point is cleared.

stop(id: ScribbleItem['id']): ScribbleItem

Parameters

NameDescription

id

Returns


tick()

Update on each animation frame.

tick(elapsed: number): void

Parameters

NameDescription

elapsed

number

The number of milliseconds since the last tick.

Returns

void

Prev
Rectangle2d
Next
ShapeUtil