From 625a42dbcb9ca3ff14d3b968d63379317a6ae16a Mon Sep 17 00:00:00 2001 From: Erik Onarheim Date: Sat, 16 Nov 2024 08:45:26 -0600 Subject: [PATCH] docs: Update ex.Animation.fromSpriteSheet jsdoc --- src/engine/Graphics/Animation.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/engine/Graphics/Animation.ts b/src/engine/Graphics/Animation.ts index b8b2e52d7..60e1e5940 100644 --- a/src/engine/Graphics/Animation.ts +++ b/src/engine/Graphics/Animation.ts @@ -210,19 +210,19 @@ export class Animation extends Graphic implements HasTick { * * const anim = Animation.fromSpriteSheet(spriteSheet, range(0, 5), 200, AnimationStrategy.Loop); * ``` - * @param spriteSheet - * @param frameIndices - * @param durationPerFrameMs - * @param strategy + * @param spriteSheet ex.SpriteSheet + * @param spriteSheetIndex 0 based index from left to right, top down (row major order) of the ex.SpriteSheet + * @param durationPerFrameMs duration per frame in milliseconds + * @param strategy Optional strategy, default AnimationStrategy.Loop */ public static fromSpriteSheet( spriteSheet: SpriteSheet, - frameIndices: number[], + spriteSheetIndex: number[], durationPerFrameMs: number, strategy: AnimationStrategy = AnimationStrategy.Loop ): Animation { const maxIndex = spriteSheet.sprites.length - 1; - const invalidIndices = frameIndices.filter((index) => index < 0 || index > maxIndex); + const invalidIndices = spriteSheetIndex.filter((index) => index < 0 || index > maxIndex); if (invalidIndices.length) { Animation._LOGGER.warn( `Indices into SpriteSheet were provided that don\'t exist: ${invalidIndices.join(',')} no frame will be shown` @@ -230,7 +230,7 @@ export class Animation extends Graphic implements HasTick { } return new Animation({ frames: spriteSheet.sprites - .filter((_, index) => frameIndices.indexOf(index) > -1) + .filter((_, index) => spriteSheetIndex.indexOf(index) > -1) .map((f) => ({ graphic: f, duration: durationPerFrameMs