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!
Methods
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 |
cancelKeys | An array of string names of keys (see |
timeout | Set a time limit for the replay. |
callback | If set, called when the replay finishes, any cancel key is pressed, or
if a timeout is triggered. Note: |
onOpen():Void
Called when the "open file" button is pressed. Opens the file dialog and registers event handlers for the file dialog.
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. |
---|
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. |
---|
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. |
---|
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()).