Rendering
Screen helpers
47 symbols, imported from @driftengine/core.
Explained in Recording and clips.
Classes
Interfaces
ClipMimeDescription- What a recording MIME type commits the file to. See
describeClipMime. ExportSizeExportTargetOptionsFrameOverlayFramePacingReport- Deciding which of a render loop's frames go into a recording, and measuring what came out.
FrameRecorderOptions- Recording what is on a canvas — or on a prepared export target — to a file.
FullscreenConditions- What the decision needs to know. Every field is observed, none of it inferred.
LockableSurface- The surface a clip is recorded from: a fixed-size frame, composited and paced.
MountedSplashOverlayImageOverlayText- Baking a mark into a still image sized to a video frame.
PixelCursorOptions- Pixel art from a string grid, as a CSS cursor value.
SplashConditions- What decides whether a badge is shown at all. Taken as data so the rule is testable in Node, which is where the engine's tests run — the mount below is verified by looking at it.
SplashOptions
Functions
bakeOverlay- Paint an overlay into a transparent canvas of exactly the frame's size.
clipBitrate- Bits per second for a frame size and rate.
clipFpsFor- The highest rate on the ladder this device can actually deliver, at this size.
describeClipMime- Read back what a recording MIME type promises, without recording anything.
drawPixelText- Lit cells of a string, at a cell size in device pixels.
exportAspect- The aspect ratio a camera must be given to frame for this export.
exportSizeExact- The size asked for, evened — for an encode whose schedule is ours.
exportSizeFor- The frame size to record at, given what the renderer is currently managing.
forcedSplash?splash=1or?splash=0, or null for anything else.fullscreenWanted- Whether to ask for fullscreen on the gesture currently being handled.
holdSplash- Keep the engine's badge up until
untilsettles, as well as until the game's first frame: a game whose first screen loads for longer than that frame — a stage, figures and their pictures on a first visit — is seen whole rather than loading.capMsis the game's own ceiling on the badge in place of the engine's twenty seconds, longer for a slow first visit or shorter, so a load that never settles is still shown in the end; the longest of several holds' wins, and the minimum hold is unchanged. isDuplicateFrame- Whether a frame read at
presentedCountrepeats the one composed atlastPresentedCount. mountSplash- Put the badge up, and hand back the two verbs that take it down.
offerClip- Hand a file to the player.
pixelCursor- @param rows one string per row; each character indexes
palette. @param palette character → CSS colour. A character absent from it is transparent, which is what makes' 'the natural empty cell. pixelTextCells- Cells a string occupies horizontally, including inter-glyph gaps.
pixelTextSize- Pixel width and height of a string at a given cell size.
requestFullscreenOnGesture- Ask for fullscreen on the next gesture of any kind, once, on a handheld.
splashDecision- When the badge gives the screen to the game. Two conditions and a cap, each for a named failure.
splashWantedstillFrame- One frame, composited with the same mark a clip would carry.
supportedClipMimeType- Whether this browser can record at all, and in what.
Types
OverlayImageSource- Anything a 2D context can draw and report a natural size for.
SplashDecision
Constants
CLIP_FPS_LADDER- Frame rates a clip may be recorded at, best first.
DEFAULT_CLIP_FPSEXPORT_FALLBACK_SCALE- How much smaller the fallback frame is, per side.
SPLASH_FADE_MS- How long the plate takes to leave. Short: this is a handoff, not a transition.
SPLASH_HARD_CAP_MS- The ceiling on the whole badge, whatever the caller asked for.
SPLASH_MIN_MS- How long the badge stays even on a machine that paints instantly.