@drincs/pixi-vn
Version:
Pixi'VN is a npm package that provides various features for creating visual novels.
47 lines (44 loc) • 1.62 kB
text/typescript
import { LabelIdType } from '../types/LabelIdType.mjs';
import { StepLabelType } from '../types/StepLabelType.mjs';
import LabelAbstract from './LabelAbstract.mjs';
import LabelProps from '../interface/LabelProps.mjs';
import '@drincs/pixi-vn/dist/override';
import '../types/StepHistoryDataType.mjs';
/**
* Label is a class that contains a list of steps, which will be performed as the game continues.
* For Ren'py this is the equivalent of a label.
* @example
* ```typescript
* const START_LABEL_ID = "StartLabel"
*
* export const startLabel = newLabel(START_LABEL_ID,
* [
* (props) => {
* GameWindowManager.clear()
* setDialogue({ character: liam, text: "Which test do you want to perform?" })
* setChoiceMenuOptions([
* new ChoiceMenuOption("Events Test", eventsTestLabel),
* new ChoiceMenuOption("Show Image Test", showImageTest),
* ])
* },
* (props) => GameStepManager.jumpLabel(START_LABEL_ID, props),
* ]
* )
*
* GameStepManager.callLabel(StartLabel)
* ```
*/
declare class Label<T extends {} = {}> extends LabelAbstract<Label<T>, T> {
/**
* @param id is the id of the label
* @param steps is the list of steps that the label will perform
* @param props is the properties of the label
*/
constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), props?: LabelProps<Label<T>>);
private _steps;
/**
* Get the steps of the label.
*/
get steps(): StepLabelType<T>[];
}
export { Label as default };