untitled-pixi-live2d-engine 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "untitled-pixi-live2d-engine",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "PixiJS v8 Live2D Engine | Supports Cubism 2-5 SDK | Lip-sync & Parallel Motion",
5
5
  "packageManager": "pnpm@10.26.2",
6
6
  "main": "dist/index.js",
package/types/index.d.ts CHANGED
@@ -744,6 +744,14 @@ export declare class FocusController {
744
744
  */
745
745
  update(dt: DOMHighResTimeStamp): void;
746
746
  }
747
+ export interface ParallelMotionStartOptions {
748
+ ignoreParamIds?: string[];
749
+ /**
750
+ * Whether the motion should loop. Overrides Cubism 3/4/5 motion JSON loop metadata when specified.
751
+ */
752
+ loop?: boolean;
753
+ }
754
+ export type ParallelMotionStartRandomOptions = Omit<ParallelMotionStartOptions, "ignoreParamIds">;
747
755
  declare abstract class ParallelMotionManager<Motion = never, MotionSpec = never> extends EventEmitter {
748
756
  /**
749
757
  * Tag for logging.
@@ -774,16 +782,18 @@ declare abstract class ParallelMotionManager<Motion = never, MotionSpec = never>
774
782
  * @param index - Index in the motion group.
775
783
  * @param priority - The priority to be applied. default: 2 (NORMAL)
776
784
  * @param ignoreParamIds - The ids to be ignored.
785
+ * @param loop - Whether the motion should loop. Overrides Cubism 3/4/5 motion JSON loop metadata when specified.
777
786
  * @return Promise that resolves with true if the motion is successfully started, with false otherwise.
778
787
  */
779
- startMotion(group: string, index: number, priority?: MotionPriority, ignoreParamIds?: string[]): Promise<boolean>;
788
+ startMotion(group: string, index: number, priority?: MotionPriority, options?: ParallelMotionStartOptions | string[]): Promise<boolean>;
780
789
  /**
781
790
  * Starts a random Motion as given priority.
782
791
  * @param group - The motion group.
783
792
  * @param priority - The priority to be applied. (default: 1 `IDLE`)
793
+ * @param loop - Whether the motion should loop. Overrides Cubism 3/4/5 motion JSON loop metadata when specified.
784
794
  * @return Promise that resolves with true if the motion is successfully started, with false otherwise.
785
795
  */
786
- startRandomMotion(group: string, priority?: MotionPriority): Promise<boolean>;
796
+ startRandomMotion(group: string, priority?: MotionPriority, { loop }?: ParallelMotionStartRandomOptions): Promise<boolean>;
787
797
  /**
788
798
  * Stops all playing motions as well as the sound.
789
799
  */
@@ -812,7 +822,7 @@ declare abstract class ParallelMotionManager<Motion = never, MotionSpec = never>
812
822
  /**
813
823
  * Starts the Motion.
814
824
  */
815
- protected abstract _startMotion(motion: Motion, onFinish?: (motion: Motion) => void, ignoreParamIds?: string[]): number;
825
+ protected abstract _startMotion(motion: Motion, onFinish?: (motion: Motion) => void, ignoreParamIds?: string[], loop?: boolean): number;
816
826
  /**
817
827
  * Stops all playing motions.
818
828
  */
@@ -4480,12 +4490,16 @@ export declare class Live2DModel<IM extends InternalModel = InternalModel> exten
4480
4490
  * group: The motion group,
4481
4491
  * index: Index in the motion group,
4482
4492
  * priority: The priority to be applied. (0: No priority, 1: IDLE, 2:NORMAL, 3:FORCE) (default: 2)
4493
+ * ignoreParamIds: The ids to be ignored,
4494
+ * loop: Whether the motion should loop.
4483
4495
  * @return Promise that resolves with a list, indicates the motion is successfully started, with false otherwise.
4484
4496
  */
4485
4497
  parallelMotion(motionList: {
4486
4498
  group: string;
4487
4499
  index: number;
4488
4500
  priority?: MotionPriority;
4501
+ ignoreParamIds?: string[];
4502
+ loop?: boolean;
4489
4503
  }[]): Promise<boolean[]>;
4490
4504
  /**
4491
4505
  * Shorthand to play the last frame of multiple motions in parallel and await their completion.