Skip to main content

setTransform

MahiruLess than 1 minute

setTransform

Sets transform and effects.

Statement Content

Sets a single-line JSON string for transform and effects.

Info

This command only generates one animation segment. If you need to set a multi-segment animation, use setAnimation or setTempAnimation.

changeFigure:character_a/normal.png -id=aaa;
; Move left
setTransform:{"position":{"x":-500},"saturation":0.8} -target=aaa -duration=500;
; Lower brightness
setTransform:{"brightness":0.5,"contrast":1.2} -target=aaa -duration=500;

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;
setTransform:{"brightness":0.5} -target=aaa -duration=500;

duration

  • Number
  • Range: 0 to positive infinity
  • Unit: milliseconds

The duration of the animation.

changeFigure:1/open_eyes.png -id=aaa;
setTransform:{"brightness":0.5} -target=aaa -duration=500;

ease

  • String

Sets the easing type used by the animation. The default value is easeInOut. Available values include:

  • linear: linear
  • easeIn: ease in
  • easeOut: ease out
  • easeInOut: ease in and out
  • circIn: circular ease in
  • circOut: circular ease out
  • circInOut: circular ease in and out
  • backIn: back ease in
  • backOut: back ease out
  • backInOut: back ease in and out
  • bounceIn: bounce in
  • bounceOut: bounce out
  • bounceInOut: bounce in and out
  • anticipate: anticipate

Any other string falls back to the default value.

changeFigure:1/open_eyes.png -id=aaa;
setTransform:{"brightness":0.5} -target=aaa -duration=500 -ease=linear;

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;
setTransform:{"brightness":0.5} -target=aaa -duration=500 -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.

; Assume this is a very long animation
setTransform:{"scale":{"x":2,"y":2}} -target=aaa -duration=10000 -keep -next;
CharacterA:First line;
CharacterA:Second line;
CharacterA:Third line;
; This interrupts aaa's cross-statement animation and plays a new animation
setTransform:{"scale":{"x":1,"y":1}} -target=aaa -duration=10000 -keep -next;