# Function: add() (/jsdoc/pixi-vn/index/namespaces/RegisteredEvents/functions/add)



\> **add**(`fn`, `name`): `void`

Defined in: [src/canvas/decorators/event-decorator.ts:43](https://github.com/DRincs-Productions/pixi-vn/blob/998c1a75c5978f24c0dc137af5f42b90b2803967/src/canvas/decorators/event-decorator.ts#L43)

Register a event in the game.

Parameters [#parameters]

fn [#fn]

`SerializableEventHandler`

The class of the event.

name [#name]

`string`

Name of the event, by default it will use the class name. If the name is already registered, it will show a warning

Returns [#returns]

`void`
