LogoPixi’VN
indexFunctions

Function: eventDecorator()

> eventDecorator(name?): (_target, propertyKey, descriptor) => void

Defined in: src/canvas/decorators/event-decorator.ts:29

Is a decorator that register a event in the game. Is a required decorator for use the event in the game. Thanks to this decoration the game has the possibility of updating the events to the latest modification and saving the game.

Parameters

name?

string

The id used by Pixi’VN to refer to this function (must be unique). If you don't pass the id, the function name will be used as the id.

Returns

(_target, propertyKey, descriptor) => void

Example

export class Events {
    \@eventDecorator()
    static eventExample(event: FederatedEvent, component: Sprite) {
        // event code here
    }
}

sprite.on("pointerdown", Events.eventExample);

On this page