From 3f6dce29b9e98a4f2167a751a1e3308d96cbc297 Mon Sep 17 00:00:00 2001 From: George FunBook Date: Thu, 9 May 2024 14:14:19 -0500 Subject: [PATCH] add docs --- flixel/system/replay/FlxReplay.hx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flixel/system/replay/FlxReplay.hx b/flixel/system/replay/FlxReplay.hx index 510fcaf5e0..013092f684 100644 --- a/flixel/system/replay/FlxReplay.hx +++ b/flixel/system/replay/FlxReplay.hx @@ -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; @@ -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; }