# Function: onLabelClosing() (/pixi-vn/index/namespaces/Game/functions/onLabelClosing)



\> **onLabelClosing**(`value`): `void`

Defined in: [src/index.ts:462](https://github.com/DRincs-Productions/pixi-vn/blob/5bb5bb1f92e38998ea2f477b600168d8da3ece19/src/index.ts#L462)

Is a function that will be executed every time the current label is about to close because it
naturally ran out of steps and control is returning to the label that called it.

By default (when this is not set), the label closes immediately, exactly like before this hook
existed. If you set it, you take control: call `defaultClose()` yourself whenever you actually
want the label to close — right away, or later (e.g. on a subsequent player action in your
template). Until `defaultClose()` is called, the label stays open and narration does not
continue into the parent label.

This does not fire for a `jump` or a choice's `closeCurrentLabel` option - those close the
current label as part of starting a new one, so [onLabelStarting](/pixi-vn/index/namespaces/Game/functions/onLabelStarting) already covers
deferring them.

## Parameters [#parameters]

### value [#value]

(`labelId`, `props`, `defaultClose`) => [`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType) | `Promise`\<[`StepLabelResultType`](/pixi-vn/index/type-aliases/StepLabelResultType)>

## Returns [#returns]

`void`

## Example [#example]

```ts
Game.onLabelClosing((labelId, props, defaultClose) => {
    pendingLabelClose = defaultClose; // keep it for later, don't run it now
})
```
