> For the complete documentation index, see [llms.txt](https://fehdead.gitbook.io/npc-kit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fadelayer.md).

# npc.fadelayer

```lua
npc.fadelayer(layer)
```

|                         |                                   |
| ----------------------- | --------------------------------- |
| id                      | `0x0158`                          |
| arguments               | 1: Int                            |
| in NPC Kit              | yes                               |
| measured from a kit NPC | returns                           |
| vanilla scripts         | 4587 calls in 760 of 1114 scripts |

## What it does

Sets the draw stage of the next screen fade: what the fade covers and what stays drawn over it. The stage goes back to the default after each fade starts.

## Arguments

### `layer` (Int)

The stage; `6` is the default. Vanilla: `6` (3,183 calls), `5` (1,399), `2`.

## Timing

Returns at once; applies to the next `fadeout` / `fadein`.

## In NPC Kit

The scene examples use the default. Which stage keeps which layer (the HUD, windows) visible is not confirmed here.

## Used with

* [fadeout](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fadeout.md), [fadein](https://fehdead.gitbook.io/npc-kit/vm-reference/calls/fadein.md).

## Example

The vanilla shape: the stage set just before the fade it applies to. What `5` keeps drawn over the black is not confirmed here; check it in the game.

```lua
blackout = function()
    npc.fadelayer(5);
    npc.fadeout(15);
    npc.fadesync();
end,
```

## Pitfalls

* It applies to one fade only: set it again before the next.
