changeFigureDiff
changeFigureDiff
Switches the variant (diff) of an image figure, such as changing its expression.
Statement Content
The path of the variant image.
changeFigure:hero/normal.png -id=hero;
; Switch figure hero to the smiling variant
changeFigureDiff:hero/smile.png -id=hero;
Unlike changeFigure, which replaces the figure, changeFigureDiff only replaces the image. All other state of the figure is kept, including its transform, layer (zIndex), blend mode, and enter/exit settings.
Switching a variant is not an exit, so no exit animation is played. These settings take effect later, when changeFigure actually replaces the figure.
changeFigure:hero/normal.png -id=hero -exit=exit-to-right;
; Switch the variant; no exit animation is played
changeFigureDiff:hero/smile.png -id=hero;
; Replace the figure; smile.png exits with exit-to-right
changeFigure:other/normal.png -id=hero;
When both images have exactly the same size and are fully loaded, the variant switches with a cross-blend of about 200 ms. Otherwise, the old image fades out and the new one fades in, and the figure's transform is kept.
Info
- Live2D and Spine figures have their own expression and motion systems. Use arguments such as
motionandexpressionofchangeFigureinstead. If the current figure or the target is a model, this statement is not executed. - If there is no figure to replace, or the content is
none, this statement behaves likechangeFigure. - To change the transform, animation, or other arguments at the same time, use
changeFigure.
Parameters
Apart from the arguments below and general arguments such as next, continue, and when, all other arguments are ignored with a warning in the console.
id
- String
The id of the figure whose variant is switched. If omitted, the target figure is determined by position arguments such as left and right, defaulting to the center figure.
changeFigureDiff:hero/smile.png -id=hero;
left
- Boolean
If id is omitted, switches the variant of the left figure.
changeFigure:hero/normal.png -left;
changeFigureDiff:hero/smile.png -left;
right
- Boolean
If id is omitted, switches the variant of the right figure.
changeFigure:hero/normal.png -right;
changeFigureDiff:hero/smile.png -right;
left13 / right13 / left14 / right14
- Boolean
If id is omitted, switches the variant of the figure at the corresponding position.
changeFigure:hero/normal.png -left13;
changeFigureDiff:hero/smile.png -left13;
mouthOpen, mouthHalfOpen, mouthClose, eyesOpen, eyesClose, animationFlag
- String
Mouth and blink variants, used the same way as in changeFigure.
Mouth and blink images usually match a specific expression, so switching a variant replaces them entirely with the arguments of this statement. Any omitted item is disabled.
changeFigure:hero/normal.png -id=hero -mouthOpen=hero/normal_open.png -mouthClose=hero/normal.png;
; The smiling variant uses its own mouth images
changeFigureDiff:hero/smile.png -id=hero -mouthOpen=hero/smile_open.png -mouthClose=hero/smile.png;