Skip to main content

setTempAnimation

MahiruLess than 1 minute

setTempAnimation

Sets a temporary animation.

Statement Content

Unlike setAnimation, which reads animation files, setTempAnimation allows users to define multi-segment animations directly in code. See Animation Reference for details.
The statement content format is the one-line form of an animation file: [{},{},{}].

Info

If you want to reuse an animation, use setAnimation.
If you only want to set a single-segment animation, use setTransform.

changeFigure:1/open_eyes.png -id=aaa;
; Flashbang animation
setTempAnimation:[{"duration":0},{"brightness":2,"contrast":0,"duration":200,"ease":"circIn"},{"brightness":1,"contrast":1,"duration":200},{"brightness":2,"contrast":0,"duration":200,"ease":"circIn"},{"brightness":1,"contrast":1,"duration":2500}] -target=aaa;

Parameters

target

  • String

The target of an animation.

Available targets:

  • fig-center: center figure
  • fig-left: left figure
  • fig-right: right figure
  • The id of a free figure
  • bg-main: background
  • stage-main: stage
changeFigure:1/open_eyes.png -id=aaa;
setTempAnimation:[{"duration":0},{"brightness":2,"contrast":0,"duration":200,"ease":"circIn"},{"brightness":1,"contrast":1,"duration":200},{"brightness":2,"contrast":0,"duration":200,"ease":"circIn"},{"brightness":1,"contrast":1,"duration":2500}] -target=aaa;

writeDefault

  • Boolean

When the value is true, all unassigned transform and effect properties are written with their default values.
When the value is false, unassigned properties inherit the existing values.

changeFigure:1/open_eyes.png -id=aaa;
setTempAnimation:[{"duration":0},{"brightness":2,"contrast":0,"duration":200,"ease":"circIn"},{"brightness":1,"contrast":1,"duration":200},{"brightness":2,"contrast":0,"duration":200,"ease":"circIn"},{"brightness":1,"contrast":1,"duration":2500}] -target=aaa -writeDefault;

keep

  • Boolean

Converts the animation into a cross-statement animation. The current animation keeps playing while subsequent statements run, until it ends or is interrupted by another setTransform, setAnimation, or setTempAnimation with the same target.
It is usually used together with the next parameter.

changeFigure:1/open_eyes.png -id=aaa;
setTempAnimation:[{"duration":0},{"scale":{"x":2,"y":2},"duration":10000}] -target=aaa -keep -next;
CharacterA:First line;
CharacterA:Second line;
CharacterA:Third line;
; This interrupts aaa's cross-statement animation and plays a new animation
setTempAnimation:[{"duration":0},{"scale":{"x":1,"y":1},"duration":10000}] -target=aaa -keep -next;