Skip to content

Commit

Permalink
add FlxReplay getDuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli committed Mar 29, 2024
1 parent 5b812e2 commit 14d9101
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions flixel/system/replay/FlxReplay.hx
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,16 @@ class FlxReplay
FlxArrayUtil.setLength(_frames, _capacity);
frameCount = 0;
}

/**
* Returns the last recorded frame index. **Note:** this is different from `frameCount`, which
* is the number of unique records, which doesn't count frames with no input
*/
public function getDuration()
{
if (_frames != null)
return _frames[_frames.length - 1].frame;

return 0;
}
}

0 comments on commit 14d9101

Please sign in to comment.