LogoPixi’VN
indexNamespacesGameFunctions

Function: start()

> start<T>(label, props): Promise<StepLabelResultType>

Defined in: src/index.ts:282

Start the game with a label. This function will clear all the game data and start the narration from the specified label.

Type Parameters

T

T extends object = { }

Parameters

label

string | LabelAbstract<any, T, number>

The label to start the game with. It can be a string or a LabelAbstract instance. If it is a string, it will be used as the id of the label to start. If it is a LabelAbstract instance, it will be used directly. If the label is not found, an error will be thrown.

props

StepLabelPropsType<T>

The properties to pass to the label. It will be passed to the StepLabelType of the label when it is executed.

Returns

Promise<StepLabelResultType>

The result of the label execution. It can be a StepLabelResultType or a Promise that resolves to a StepLabelResultType.