Class: CubismLegacyMotionManager
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5030
Handles the motion playback for Live2D models. Responsible for loading, playing, and managing motion states and audio.
Emits
Extends
MotionManager<Live2DMotion,Motion>
Constructors
Constructor
> new CubismLegacyMotionManager(parent): CubismLegacyMotionManager
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5040
Parameters
parent
Returns
CubismLegacyMotionManager
Overrides
Properties
currentAnalyzer?
> optional currentAnalyzer?: AnalyserNode
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3434
Analyzer element for the current sound being played.
Inherited from
currentAudio?
> optional currentAudio?: Sound
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3429
Audio element of the current motion if a sound file is defined with it.
Inherited from
currentContext?
> optional currentContext?: AudioContext
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3439
Context element for the current sound being played.
Inherited from
definitions
> abstract readonly definitions: Partial<Record<string, Motion[]>>
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5031
Motion definitions copied from ModelSettings.
Overrides
destroyed
> destroyed: boolean
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3449
Flags whether the instance has been destroyed.
Inherited from
expressionManager?
> abstract optional expressionManager?: CubismLegacyExpressionManager
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5039
Expression manager for handling model expressions. Can be undefined if the settings define no expression.
Overrides
MotionManager.expressionManager
groups
> abstract readonly groups: object
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5032
Motion groups with specific internal usages. Includes at least the 'idle' field.
idle
> readonly idle: "idle"
Overrides
lipSyncIds
> readonly lipSyncIds: string[]
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5037
motionDataType
> abstract readonly motionDataType: "arraybuffer" = "arraybuffer"
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5035
Indicates the content type of the motion files, varies in different Cubism versions.
Used as xhr.responseType.
Overrides
motionGroups
> motionGroups: Partial<Record<string, (Motion | undefined | null)[]>>
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3419
The Motions. The structure is the same as definitions, initially each group contains
an empty array, which means all motions will be undefined. When a Motion has been loaded,
it'll fill the place in which it should be; when it fails to load, the place will be filled
with null.
Inherited from
parent
> parent: InternalModel
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3454
Reference to the parent InternalModel.
Inherited from
playing
> playing: boolean
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3444
Flags whether there is a motion currently playing.
Inherited from
queueManager
> readonly queueManager: MotionQueueManager
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5036
settings
> readonly settings: CubismLegacyModelSettings
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5038
The ModelSettings reference.
Overrides
state
> state: MotionState
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3424
Maintains the state of this MotionManager.
Inherited from
tag
> tag: string
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3378
Tag for logging.
Inherited from
prefixed
> static prefixed: string | boolean
Defined in: node_modules/eventemitter3/index.d.ts:9
Inherited from
Methods
_startMotion()
> abstract protected _startMotion(motion, onFinish?, ignoreParamIds?, _loop?): number
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5047
Starts the Motion.
Parameters
motion
Live2DMotion
The Motion to start.
onFinish?
(motion) => void
Optional callback when finished.
ignoreParamIds?
string[]
The ids to be ignored.
_loop?
boolean
Returns
number
An ID or token for the motion.
Overrides
_stopAllMotions()
> abstract protected _stopAllMotions(): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5048
Stops all playing motions.
Returns
void
Overrides
addListener()
> addListener<T>(event, fn, context?): this
Defined in: node_modules/eventemitter3/index.d.ts:45
Type Parameters
T
T extends string | symbol
Parameters
event
T
fn
(...args) => void
context?
any
Returns
this
Inherited from
createMotion()
> abstract createMotion(data, group, definition): Live2DMotion
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5043
Creates a Motion from the data.
Parameters
data
ArrayBuffer
Content of the motion file. The format must be consistent with MotionManager#motionDataType.
group
string
The motion group.
definition
The motion definition.
Returns
Live2DMotion
The created Motion.
Overrides
destroy()
> destroy(): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5050
Destroys the instance and releases all resources.
Returns
void
Emits
Overrides
emit()
> emit<T>(event, ...args): boolean
Defined in: node_modules/eventemitter3/index.d.ts:32
Calls each of the listeners registered for a given event.
Type Parameters
T
T extends string | symbol
Parameters
event
T
args
...any[]
Returns
boolean
Inherited from
eventNames()
> eventNames(): (string | symbol)[]
Defined in: node_modules/eventemitter3/index.d.ts:15
Return an array listing the events for which the emitter has registered listeners.
Returns
(string | symbol)[]
Inherited from
getMotionAndApplyExpression()
> protected getMotionAndApplyExpression(group, index, expression?): Promise<unknown>
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3637
Loads a motion and applies the given expression with FORCE priority.
Parameters
group
string
The motion group.
index
number
The motion index.
expression?
string | number
Expression to apply (optional).
Returns
Promise<unknown>
The loaded motion, or null if not started.
Inherited from
MotionManager.getMotionAndApplyExpression
getMotionFile()
> abstract getMotionFile(definition): string
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5044
Retrieves the motion's file path by its definition.
Parameters
definition
Motion definition.
Returns
string
The file path extracted from the given definition. Not resolved.
Overrides
getMotionName()
> abstract protected getMotionName(definition): string
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5045
Retrieves the motion's name by its definition.
Parameters
definition
Motion definition.
Returns
string
The motion's name.
Overrides
getSoundFile()
> abstract protected getSoundFile(definition): string | undefined
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5046
Retrieves the motion's sound file by its definition.
Parameters
definition
Motion definition.
Returns
string | undefined
The motion's sound file, or undefined.
Overrides
init()
> protected init(options?): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5041
Should be called in the constructor of derived class to initialize options and setup motions.
Parameters
options?
Initialization options for the manager.
Returns
void
Overrides
initializeAudio()
> protected initializeAudio(audio, volume): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3490
Initializes audio playback and sets up audio analysis for lipsync.
Parameters
audio
Sound
The Sound to initialize.
volume
number
The playback volume (0-1).
Returns
void
Inherited from
isFinished()
> abstract isFinished(): boolean
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5042
Checks if the motion playback has finished.
Returns
boolean
Overrides
listenerCount()
> listenerCount(event): number
Defined in: node_modules/eventemitter3/index.d.ts:27
Return the number of listeners listening to a given event.
Parameters
event
string | symbol
Returns
number
Inherited from
listeners()
> listeners<T>(event): (...args) => void[]
Defined in: node_modules/eventemitter3/index.d.ts:20
Return the listeners registered for a given event.
Type Parameters
T
T extends string | symbol
Parameters
event
T
Returns
(...args) => void[]
Inherited from
loadMotion()
> loadMotion(group, index): Promise<Live2DMotion | undefined>
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3479
Loads a Motion in a motion group. Errors in this method will not be thrown, but be emitted with a "motionLoadError" event.
Parameters
group
string
The motion group.
index
number
Index in the motion group.
Returns
Promise<Live2DMotion | undefined>
Promise that resolves with the Motion, or with undefined if it can't be loaded.
Emits
MotionManagerEvents.motionLoaded
Emits
MotionManagerEvents.motionLoadError
Inherited from
motionLastFrame()
> abstract motionLastFrame(group, index, expression?): Promise<boolean>
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5051
Play the last frame of the given motion, optionally applying an expression.
Parameters
group
string
Motion group.
index
number
Motion index.
expression?
Expression to apply (optional).
expression?
string | number
Returns
Promise<boolean>
Promise resolving to true if successful.
Overrides
mouthSync()
> mouthSync(): number
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3560
Move the mouth for lipsync.
Returns
number
The current lipsync value.
Inherited from
off()
> off<T>(event, fn?, context?, once?): this
Defined in: node_modules/eventemitter3/index.d.ts:69
Type Parameters
T
T extends string | symbol
Parameters
event
T
fn?
(...args) => void
context?
any
once?
boolean
Returns
this
Inherited from
on()
> on<T>(event, fn, context?): this
Defined in: node_modules/eventemitter3/index.d.ts:40
Add a listener for a given event.
Type Parameters
T
T extends string | symbol
Parameters
event
T
fn
(...args) => void
context?
any
Returns
this
Inherited from
once()
> once<T>(event, fn, context?): this
Defined in: node_modules/eventemitter3/index.d.ts:54
Add a one-time listener for a given event.
Type Parameters
T
T extends string | symbol
Parameters
event
T
fn
(...args) => void
context?
any
Returns
this
Inherited from
removeAllListeners()
> removeAllListeners(event?): this
Defined in: node_modules/eventemitter3/index.d.ts:79
Remove all listeners, or those of the specified event.
Parameters
event?
string | symbol
Returns
this
Inherited from
MotionManager.removeAllListeners
removeListener()
> removeListener<T>(event, fn?, context?, once?): this
Defined in: node_modules/eventemitter3/index.d.ts:63
Remove the listeners of a given event.
Type Parameters
T
T extends string | symbol
Parameters
event
T
fn?
(...args) => void
context?
any
once?
boolean
Returns
this
Inherited from
setupMotions()
> protected setupMotions(options?): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3469
Sets up motions from the definitions, and preloads them according to the preload strategy.
Parameters
options?
Options controlling which motions to preload.
Returns
void
Inherited from
speak()
> speak(sound, volume?): Promise<boolean>
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3502
Only play sound with lip sync.
Parameters
sound
string
The audio url or base64 content.
volume?
Volume of the sound (0-1).
expression?
string | number
onError?
(e) => void
onFinish?
() => void
resetExpression?
boolean
volume?
number
Returns
Promise<boolean>
Promise that resolves with true if the sound is playing, false otherwise.
Inherited from
startMotion()
> startMotion(group, index, priority?, sound?): Promise<boolean>
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3525
Starts a motion with the given priority.
Parameters
group
string
The motion group.
index
number
Index in the motion group.
priority?
The priority to be applied. Default: NORMAL (2).
sound?
The audio url or base64 content.
Returns
Promise<boolean>
Promise that resolves with true if the motion is successfully started, false otherwise.
Inherited from
startRandomMotion()
> startRandomMotion(group, priority?, sound?): Promise<boolean>
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3540
Starts a random Motion as given priority.
Parameters
group
string
The motion group.
priority?
The priority to be applied. Default: IDLE (1).
sound?
The audio url or base64 content.
Returns
Promise<boolean>
Promise that resolves with true if the motion is successfully started, false otherwise.
Inherited from
MotionManager.startRandomMotion
stopAllMotions()
> stopAllMotions(): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3548
Stops all playing motions as well as the sound.
Returns
void
Inherited from
stopSpeaking()
> stopSpeaking(): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3544
Stops current audio playback and lipsync.
Returns
void
Inherited from
update()
> update(model, now): boolean
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:3555
Updates parameters of the core model.
Parameters
model
object
The core model.
now
number
Current time in milliseconds.
Returns
boolean
True if the parameters have been actually updated.
Inherited from
updateParameters()
> abstract protected updateParameters(model, _now): boolean
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5049
Updates parameters of the core model.
Parameters
model
Live2DModelWebGL
The core model.
_now
number
Returns
boolean
True if the parameters have been actually updated.