Interface: LabelProps<T, StepIdType>
Defined in: src/narration/interfaces/LabelProps.ts:3
Type Parameters
T
T
StepIdType
StepIdType = number
Properties
onLoadingLabel?
> optional onLoadingLabel?: (stepId, label) => void | Promise<void>
Defined in: src/narration/interfaces/LabelProps.ts:29
Is a function that will be executed in Label.onStepStart if the id of the step is 0 and when the user laods a save file. When you load a save file, will be executed all onLoadingLabel functions of the narration.openedLabels. It is useful for example to make sure all images used have been cached
Parameters
stepId
StepIdType
Step id
label
T
Label
Returns
void | Promise<void>
Example
newLabel("id", [], {
onLoadingLabel: async (stepId, label) => {
await Assets.load('path/to/image1.png')
await Assets.load('path/to/image2.png')
}
})
onStepEnd?
> optional onStepEnd?: (stepId, label) => void | Promise<void>
Defined in: src/narration/interfaces/LabelProps.ts:36
Is a function that will be executed when the step ends.
Parameters
stepId
StepIdType
Step id
label
T
Label
Returns
void | Promise<void>
onStepStart?
> optional onStepStart?: (stepId, label) => void | Promise<void>
Defined in: src/narration/interfaces/LabelProps.ts:10
Is a function that will be executed before any step is executed.
Parameters
stepId
StepIdType
Step id
label
T
Label
Returns
void | Promise<void>