Skip to content

anim-format (runtime format) / LoopGuard

Class: LoopGuard<T> ​

The same-frame loop guard (owner 2026-11-05, changed 2026-11-14): within one ROUND (one cascade of actions started by a frame, a click or a script call), a gotoNow back to a frame the clip already visited in that round would loop for ever — THAT jump is void (nothing moves, the clip plays on), with a console warning. gotoAfter never loops here: it waits a frame time, so it is a round of its own.

Type Parameters ​

Type Parameter
T extends object

Constructors ​

Constructor ​

ts
new LoopGuard<T>(): LoopGuard<T>;

Returns ​

LoopGuard<T>

Methods ​

mark() ​

ts
mark(t, frame): void;

a frame the clip is on (a round starts there / arrives there)

Parameters ​

ParameterType
tT
framenumber

Returns ​

void


round() ​

ts
round<R>(fn): R;

runs fn as (part of) a round; the outermost call ends it

Type Parameters ​

Type Parameter
R

Parameters ​

ParameterType
fn() => R

Returns ​

R


visit() ​

ts
visit(t, frame): boolean;

a jump of t to frame: false = it was already there this round (the jump is void)

Parameters ​

ParameterType
tT
framenumber

Returns ​

boolean

HereSplash — 2D animation for the web