AnimationFrameTickSource
Defined in: src/modules/tick/animation-frame-tick-source.ts:33
Time-driven tick source that fires once per requestAnimationFrame
(typically ~60 Hz, matching the display refresh rate). Suitable for:
- Render loops where the game draws on every frame.
- Edge-clearing for input that wants per-frame resolution.
- Variable-rate simulations that integrate with
deltaMs.
Emits TickInfo { kind: 'variable', deltaMs: wall-time, tickNumber }.
deltaMs is the measured wall-clock interval between frames (0 on the
very first tick since there is no previous frame to measure against).
Frames are delivered paused while the tab is in the background on most
browsers — consumers that need catch-up semantics should layer a fixed
accumulator on top.
start() / stop() are idempotent. stop() cancels the pending
rAF and resets the internal timing baseline, so the next start()
begins cleanly.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AnimationFrameTickSource(
options?):AnimationFrameTickSource
Defined in: src/modules/tick/animation-frame-tick-source.ts:63
Parameters
Section titled “Parameters”options?
Section titled “options?”AnimationFrameTickSourceOptions = {}
Returns
Section titled “Returns”AnimationFrameTickSource
Accessors
Section titled “Accessors”tickNumber
Section titled “tickNumber”Get Signature
Section titled “Get Signature”get tickNumber():
number
Defined in: src/modules/tick/animation-frame-tick-source.ts:100
Returns
Section titled “Returns”number
Methods
Section titled “Methods”start()
Section titled “start()”start():
void
Defined in: src/modules/tick/animation-frame-tick-source.ts:81
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”stop()
Section titled “stop()”stop():
void
Defined in: src/modules/tick/animation-frame-tick-source.ts:87
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”subscribe()
Section titled “subscribe()”subscribe(
handler): () =>void
Defined in: src/modules/tick/animation-frame-tick-source.ts:95
Parameters
Section titled “Parameters”handler
Section titled “handler”(info) => void
Returns
Section titled “Returns”() => void