Package-level declarations

Types

Link copied to clipboard
sealed interface CanvasKind : ComponentKind
Link copied to clipboard

A helper class which lets callers trigger a repaint manually.

Link copied to clipboard
class RenderScope<C : RenderingContext>(val ctx: C, val width: Int, val height: Int, val colorMode: ColorMode, val elapsedMs: Double)

Arguments passed to the user's render callback.

Properties

Link copied to clipboard
Link copied to clipboard

A millisecond value which, if used, will result in a 30FPS render.

Link copied to clipboard

A millisecond value which, if used, will result in a 60FPS render.

Link copied to clipboard

A millisecond value which, if used, will result in a canvas that never repaints on its own.

Functions

Link copied to clipboard
@Composable
fun Canvas2d(width: Int, height: Int, modifier: Modifier = Modifier, variant: CssStyleVariant<CanvasKind>? = null, repainter: CanvasRepainter? = null, minDeltaMs: Number = if (repainter != null) REPAINT_CANVAS_MANUALLY else 0.0, maxDeltaMs: Number = max(500.0, minDeltaMs.toDouble()), ref: ElementRefScope<HTMLCanvasElement>? = null, render: RenderScope<CanvasRenderingContext2D>.() -> Unit)

Renders a Canvas using the "2d" rendering context.

Link copied to clipboard
@Composable
fun CanvasGl(width: Int, height: Int, modifier: Modifier = Modifier, variant: CssStyleVariant<CanvasKind>? = null, repainter: CanvasRepainter? = null, minDeltaMs: Number = if (repainter != null) REPAINT_CANVAS_MANUALLY else 0.0, maxDeltaMs: Number = max(500.0, minDeltaMs.toDouble()), ref: ElementRefScope<HTMLCanvasElement>? = null, render: RenderScope<WebGLRenderingContext>.() -> Unit)

Renders a Canvas using the "webgl" rendering context.

Link copied to clipboard
@Composable
fun CanvasGl2(width: Int, height: Int, modifier: Modifier = Modifier, variant: CssStyleVariant<CanvasKind>? = null, repainter: CanvasRepainter? = null, minDeltaMs: Number = if (repainter != null) REPAINT_CANVAS_MANUALLY else 0.0, maxDeltaMs: Number = max(500.0, minDeltaMs.toDouble()), ref: ElementRefScope<HTMLCanvasElement>? = null, render: RenderScope<WebGL2RenderingContext>.() -> Unit)

Renders a Canvas using the "webgl2" rendering context.