Screen helpers · interface
ExportTargetOptions
Explained in Recording and clips.
interface ExportTargetOptionsimport type { ExportTargetOptions } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
sourcereadonly | HTMLCanvasElement | The canvas the scene is drawn into. |
surfacereadonly | LockableSurface | Whoever owns that canvas's drawing-buffer size. |
widthreadonly | number | |
heightreadonly | number | |
fpsreadonly | number | |
overlayreadonlyoptional | FrameOverlay | ((width: number, height: number) => FrameOverlay) | Stamped into every frame, and baked once.MoreAccepts a function of the final frame size, because the size is not always the one asked for — a device that cannot hold the rate records smaller. A mark laid out for the larger frame and drawn into the smaller one lands on fractional pixels, which is the difference between a wordmark and a smudge. |
drawFramereadonlyoptional | (ctx: CanvasRenderingContext2D, width: number, height: number) => void | Drawn into every frame, live.MoreThe counterpart to Called once per composed frame, including the still-image path, so a still
carries whatever a clip would. Receives the final frame size for the same
reason The context is owned by the target: a hook that leaves transforms, clips or composite state behind will corrupt later frames, so it must restore what it changes. Save/restore is wrapped here so the common case needs no discipline. |
presentedFramesreadonlyoptional | () => number | The renderer's own presented-frame count, e.g. () => renderer.presentedFrames.MoreOptional, and reached for no reason but this: |