DriftTexture · function

rewindOverlay

Put the overlay back to how it was at upToFrame: clear, then replay.

Explained in DriftTexture.

function rewindOverlay(overlay: Overlay, journal: OverlayJournal, upToFrame: number): number
import { rewindOverlay } from '@driftengine/texture';

Parameters

ParameterTypeDescription
overlayOverlay
journalOverlayJournal
upToFramenumber

In depth

Rebuilt rather than undone, because a write is not invertible — two marks on one texel leave no record of what was underneath, and an overlay that tried to undo would need a history per texel, which is the dense layer the whole design exists to avoid.