Accessed via FlxG.vcr.

Variables

cancelKeys:Array<FlxKey>

The keys used to toggle the debugger. "MOUSE" to cancel with the mouse. Handy for skipping cutscenes or getting out of attract modes!

@:value(false)paused:Bool = false

Whether the debugger has been paused.

@:value(false)stepRequested:Bool = false

Whether a "1 frame step forward" was requested.

@:value(0)timeout:Float = 0

Helps time out a replay if necessary.

replayCallback:() ‑> Void

This function, if set, is triggered when the callback stops playing.

Methods

@:value({ timeout : 0 })loadReplay(data:String, ?state:NextState, ?cancelKeys:Array<FlxKey>, timeout:Float = 0, ?callback:() ‑> Void):Void

Load replay data from a string and play it back.

Parameters:

data

The replay that you want to load.

state

If you recorded a state-specific demo or cutscene, pass a state constructor here, just as you would to to FlxG.switchState.

cancelKeys

An array of string names of keys (see FlxKeyboard) that can be pressed to cancel the playback, e.g. [ESCAPE,ENTER]. Also accepts 2 custom key names: ANY and MOUSE.

timeout

Set a time limit for the replay. cancelKeys will override this, if pressed.

callback

If set, called when the replay finishes, any cancel key is pressed, or if a timeout is triggered. Note: cancelKeys and timeout will NOT call FlxG.stopReplay() if callback is set!

onOpen():Void

Called when the "open file" button is pressed. Opens the file dialog and registers event handlers for the file dialog.

pause():Void

Pause the main game loop

@:value({ StandardMode : true })reloadReplay(StandardMode:Bool = true):Void

Resets the game or state and replay requested flag.

Parameters:

StandardMode

If true, reload entire game, else just reload current game state.

@:value({ StandardMode : false })restartReplay(StandardMode:Bool = false):Void

Called when the user presses the Rewind-looking button. If Alt is pressed, the entire game is reset. If Alt is NOT pressed, only the current state is reset. The GUI is updated accordingly.

Parameters:

StandardMode

Whether to reset the current game (== true), or just the current state. Just resetting the current state can be very handy for debugging.

resume():Void

Resume the main game loop from FlxG.vcr.pause();

@:value({ StandardMode : true })startRecording(StandardMode:Bool = true):Void

Resets the game or state and requests a new recording.

Parameters:

StandardMode

If true, reset the entire game, else just reset the current state.

@:value({ OpenSaveDialog : true })inlinestopRecording(OpenSaveDialog:Bool = true):String

Stop recording the current replay and return the replay data.

Parameters:

OpenSaveDialog

If true, and targeting flash, open an OS-native save dialog for the user to choose where to save the data, and save it there.

Returns:

The replay data in simple ASCII format (see FlxReplay.save()).

inlinestopReplay():Void

Stops the current replay.