Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli committed May 9, 2024
1 parent 80faec7 commit 3f6dce2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion flixel/system/replay/FlxReplay.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class FlxReplay

/**
* The number of frames in this recording.
* **Note:** This doesn't include empty records, unlike `getDuration()`
*/
public var frameCount:Int;

Expand Down Expand Up @@ -243,13 +244,18 @@ class FlxReplay
}

/**
* Returns the last recorded frame index. **Note:** this is different from `frameCount`, which
* The duration of this replay, in frames. **Note:** this is different from `frameCount`, which
* is the number of unique records, which doesn't count frames with no input
*
* @since 5.9.0
*/
public function getDuration()
{
if (_frames != null)
{
// Add 1 to the last frame index, because they are zero-based
return _frames[_frames.length - 1].frame + 1;
}

return 0;
}
Expand Down

0 comments on commit 3f6dce2

Please sign in to comment.