Reintent

@reintent/scene/canvas

Drawing in immediate mode.

A <Draw> is a Canvas drawing owned by a semantic path: its function is free (any Canvas calls, in scene units), run every frame on the stage's canvas, and once more through a colouring context to be measured and picked, so a thing drawn on Canvas is named, measured and hit like one drawn in SVG.

Interfaces

DrawProps

Defined in: packages/scene/src/canvas.ts

The props of <Draw>.

Properties

PropertyTypeDescription
fnDrawFnThe drawing: any Canvas calls, in scene units, at the scene's time.
part?stringA part of the thing it is drawn inside: the drawing is owner.part's.
path?stringThe path that owns the drawing; by default the semantic thing it is drawn inside.

Functions

Draw()

function Draw(props): null;

Defined in: packages/scene/src/canvas.ts

A drawing owned by a semantic path. Put it inside the thing it belongs to and name the part (<Draw part="beam">), or give the whole path. The function is swapped without registering again, so it may close over props.

Parameters

ParameterType
propsDrawProps

Returns

null

References

DrawFn

Re-exports DrawFn

Last updated on

Edit on GitHub