@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
| Property | Type | Description |
|---|---|---|
fn | DrawFn | The drawing: any Canvas calls, in scene units, at the scene's time. |
part? | string | A part of the thing it is drawn inside: the drawing is owner.part's. |
path? | string | The 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
| Parameter | Type |
|---|---|
props | DrawProps |
Returns
null
References
DrawFn
Re-exports DrawFn
Last updated on
Edit on GitHub