Module recorder

Records and replays the motion of an Entity

Recorder extends BoundObject

Properties

state (readonly) The current Recorder state
entity The Entity being captured or controlled by the recorder.

Class Methods

Recorder:new (preroll_ms) Create a new Recorder instance.

Instance Methods

recorder:play () Play the Recorder.
recorder:pause () Pause the Recorder.
recorder:rewind () Rewind the Recorder.
recorder:record () Start recording.
recorder:clear () Clear the recorded contents.

Hooks

finished_playing (self) Called when the Recorder has reached the end of playback.

Constants

STATE_IDLE A Recorder state in which it is idle/paused.
STATE_RECORDING A Recorder state in which it is recording.
STATE_PLAYING A Recorder state in which it playing.


Properties

Properties. Significant fields on an instance.
state
(readonly) The current Recorder state

see also:

entity
The Entity being captured or controlled by the recorder.

Class Methods

Class Methods. Must be called on Class, with a capital leading character. e.g. Class:method("foo")
Recorder:new (preroll_ms)
Create a new Recorder instance.

Parameters:

  • preroll_ms number The amount of preroll for the recorder. (Currently unused)

Returns:

    Recorder

Instance Methods

Instance Methods. Must be called on an instance of Class. e.g. instance:method("foo")
recorder:play ()
Play the Recorder.

Returns:

    nil
recorder:pause ()
Pause the Recorder.

Returns:

    nil
recorder:rewind ()
Rewind the Recorder.

Returns:

    nil
recorder:record ()
Start recording. This actively gathers data and leaks memory if left unpaused.

Returns:

    nil
recorder:clear ()
Clear the recorded contents. This frees any memory allocated by record.

Returns:

    nil

Hooks

Hooks. Callbacks implemented in subclasses to customize behavior. Hooks are called on individual instances.
finished_playing (self)
Called when the Recorder has reached the end of playback.

Parameters:

  • self Recorder The Recorder instance

Constants

Constants. Accessed at the class level e.g. Class.CONSTANT
STATE_IDLE
A Recorder state in which it is idle/paused.
STATE_RECORDING
A Recorder state in which it is recording.

Note that if a recorder is recording, it is actively gathering data. Leaving a recorder recording accidentally will leak memory.

STATE_PLAYING
A Recorder state in which it playing.
generated by LDoc 1.3.12