setTransform
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 figurefig-left: left figurefig-right: right figure- The id of a free figure
bg-main: backgroundstage-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: lineareaseIn: ease ineaseOut: ease outeaseInOut: ease in and outcircIn: circular ease incircOut: circular ease outcircInOut: circular ease in and outbackIn: back ease inbackOut: back ease outbackInOut: back ease in and outbounceIn: bounce inbounceOut: bounce outbounceInOut: bounce in and outanticipate: 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;