bgm
bgm
A four-in-one command for playing background music, switching background music, stopping background music, and setting background music parameters.
Statement Content
Sets the path of the background music. When the file path is empty or none, playback stops.
See Audio for details.
; If no BGM exists, this plays BGM.
bgm:01.wav;
; If BGM already exists, this switches BGM.
bgm:02.wav;
; If none is written or nothing is written, this stops playback.
bgm:;
If the background music path stays the same, the music is not interrupted. Instead, the new parameters are applied to the current background music.
bgm:morning.wav;
; Adjust volume without interrupting the BGM
bgm:morning.wav -volume=50;
Parameters
volume
- Number
- Range: 0 to 100
- Default: 100
The music volume percentage.
bgm:01.wav -volume=100;
bgm:01.wav -volume=50; Adjust volume
enter
- Number
- Unit: milliseconds
- Range: 0 to positive infinity
- Default: 0
The fade-in duration of the background music.
bgm:01.wav -enter=1500;
bgm:02.wav -enter=1500;
unlockname
- String
Sets a display name. BGM appreciation will collect this music and show it under this name.
The same music file, strictly speaking the same path, can only have one display name. If the same music 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 music will not be collected.
bgm:01.wav -unlockname=MyBgm01;
series
- String
Sets the series name that BGM appreciation should collect this music into. If this parameter is omitted or the series name is empty, the music is collected into the default series.
Default Series
| - BGM Name 1
| - BGM Name 2
Series Name 1
| - BGM Name 3
| - BGM Name 4
| - BGM Name 5
Series Name 2
| - BGM Name 6
The same music 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 music. Make sure unlockname is also set.
bgm:01.wav -unlockname=MyBgm01 -series=MySeries01;