changeBg
changeBg
A three-in-one command for background entrance, background replacement, and background exit.
Statement Content
Sets the path of the background image. When the file path is empty or none, the background exits.
See Backgrounds and Figures for details.
; If no background exists, this makes the background enter.
changeBg:bg.png;
; If a background already exists, this replaces it.
changeBg:WebGAL_New_Enter_Image.png;
; If none is written or nothing is written, this makes the background exit.
changeBg:none;
If the background image path and id stay the same, entrance or exit animation will not be triggered.
Parameters
transform
- String
Sets a JSON string that controls the transform and effects of a stage object. See Transform and Effects Reference for details.
Note
This parameter only takes effect when an object enters or is replaced. To modify the transform and effects of an object already on stage, use commands such as setTransform, setAnimation, or setTempAnimation.
If the enter parameter is used to specify an entrance animation, this parameter will not take effect.
changeBg:bg.png -transform={"position":{"x":-50,"y":-20},"rotation":0.1,"scale":{"x":1.2,"y":1.2},"brightness":0.5,"blur":10};
enter
- String
Sets the animation played when the object enters the stage, replacing the default opacity fade-in entrance animation.
changeBg:bg.png -enter=enter-from-left;
exit
- String
Sets the animation played when the object exits the stage, replacing the default opacity fade-out exit animation.
changeBg:bg.png -exit=exit-to-right;
duration
- Number
- Range: 0 to positive infinity
- Unit: milliseconds
The duration of the animation.
Applied to the default entrance animation. Default value: 1500.
changeBg:bg.png -duration=200;
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.
Applied to the default entrance animation.
changeBg:bg.png -ease=easeOut;
unlockname
- String
Sets a display name. CG appreciation will collect this image and show it under this name.
The same image file, strictly speaking the same path, can only have one display name. If the same image is collected multiple times with different names, only the name from the last collection is kept.
If this parameter is omitted or the name is empty, the image will not be collected.
changeBg:bg.png -unlockname=MyCg01;
series
- String
Sets the series name that CG appreciation should collect this image into. If this parameter is omitted or the series name is empty, the image is collected into the default series.
Default Series
| - CG Name 1
| - CG Name 2
Series Name 1
| - CG Name 3
| - CG Name 4
| - CG Name 5
Series Name 2
| - CG Name 6
The same image file, strictly speaking the same path, can only belong to one series. If it is collected into multiple series, only the series from the last collection is kept.
Writing only series will not collect the image. Make sure unlockname is also set.
changeBg:bg.png -unlockname=MyCg01 -series=MySeries01;
enterDuration
- Number
- Unit: milliseconds
- Range: 0 to positive infinity
The entrance animation duration. If omitted, it defaults to the value of duration, whose default is 1500.
changeBg:bg.png -enterDuration=500;
exitDuration
- Number
- Unit: milliseconds
- Range: 0 to positive infinity
The exit animation duration. If omitted, the default value is 1500.
changeBg:bg.png -exitDuration=800;