# Fade out and change scenes

> Fade out, hide sprites, change the background and fade in with a single part, and stop or change the BGM too

Where the scene changes, a common sequence is to fade out, hide all sprites, change the background and then fade back in. The "Scene change" part does all four at once. You can also stop or change the BGM while the screen is dark.

The examples on this page use the project you make in the [tutorial](/en/tutorial/), "Shiori of the Library." The backgrounds `hill_night.webp` and `hill_morning.webp` are from the sample assets ("Add sample assets" in the "…" menu of the Assets screen adds them).

## Add a scene change

Here, the story moves from a scene in the library to a scene on the hill at night.

1. Select the line just before where the scene should change (here, "The chime rang to send everyone home.").
2. Double-click "Scene change" under "Common" in the parts panel.
3. In `image` in the panel on the right, choose the background for the next scene (here, `hill_night.webp`).
4. In `time`, enter the time for the fade out and for the fade in, each, in milliseconds (here, `1500`).

![The Scene change part with hill_night.webp for image and 1500 for time.](/shots/en/h-scene-change-part.webp)

In the block view, the "Scene change" tag shows the name of the background.

![The Scene change tag, showing the background's name and the time.](/shots/en/h-scene-change-row.webp)

In the game, the screen goes dark and the sprites disappear, and when it brightens, it's the hill at night. The message window is hidden once the screen is dark, and appears again with the next text.

![Partway through the fade out. The library screen is going dark.](/shots/en/h-scene-change-game.webp)

![After the fade in. The background is now the hill at night, and Shiori's sprite is gone.](/shots/en/h-scene-change-game2.webp)

## Stop or change the BGM while the screen is dark

1. Click the "Scene change" tag to select it, then click it again to show its parameters in the panel on the right.
2. To stop the BGM, check `stop-bgm`. To change it, choose a track in `bgm`.
3. In `bgm-fade`, enter the time for the old track to fade out and for the new track to fade in.

![The bgm and bgm-fade fields of the scene change.](/shots/en/h-scene-change-bgm.webp)

Either one starts once the screen has gone dark. A track set with `bgm` loops at volume 100. To set the volume or the loop points, place a separate BGM part after the scene change.

## Other parameters

| Parameter | What it sets | Default |
|---|---|---|
| fade-out, fade-in | Set the fade out and fade in times separately | Same as time |
| hold | Time to stay dark | 0ms |
| color | Color of the fade | Black |
| hide-window | Hide the message window once the screen is dark | Checked |

If you leave `image` empty, the background stays as it is and only the sprites are hidden.

If you always fade out with the same time in your project, set `time` of `@scene-change` in [Command defaults](/en/howto/command-defaults/), and you won't have to enter it every time.

## In code

```
@scene-change hill_night.webp time=1500ms
@scene-change hill_night.webp stop-bgm=true bgm-fade=300ms
@scene-change hill_morning.webp bgm=quiet_night.wav
```

For details, see [@scene-change](/en/reference/scene-change/).
