startRecording()
pixi-reels / index / startRecording
Function: startRecording()
function startRecording(
reelSet: ReelSet,
tag?: string,
options?: StartRecordingOptions): void;
Defined in: debug/debug.ts:183
Start recording the reel-set’s frame state at every key spin event
(spin:start, spin:reelLanded, spin:allLanded, spin:complete).
Each event captures a DebugSnapshot and pushes it onto a process-
wide rolling log readable via getFrames.
The tag is freeform. use it to label multiple recording sessions
so you can filter getFrames(tag) later. Call stopRecording
to detach the listeners (also fires automatically when the reel set
emits 'destroyed').
Designed for AI agents and debug harnesses. Calling startRecording
twice on the same reelSet replaces the prior recording (the previous
tag’s listeners are removed before the new ones attach).
import { startRecording, stopRecording, getFrames } from 'pixi-reels';
startRecording(reelSet, 'spin-1');
await reelSet.spin();
stopRecording(reelSet);
const frames = getFrames('spin-1'); // every snapshot tagged 'spin-1'
Parameters
| Parameter | Type | Default value |
|---|---|---|
reelSet | ReelSet | undefined |
tag | string | 'default' |
options | StartRecordingOptions | {} |
Returns
void