@drincs/pixi-vn
Version:
Pixi'VN is a npm package that provides various features for creating visual novels.
47 lines (44 loc) • 1.59 kB
TypeScript
import { LabelIdType } from '../types/LabelIdType.js';
import LabelAbstract from './LabelAbstract.js';
import { StepLabelType } from '../types/StepLabelType.js';
import LabelProps from '../interface/LabelProps.js';
import '@drincs/pixi-vn';
/**
* 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) => {
* canvas.clear()
* narration.dialogue = { character: liam, text: "Which test do you want to perform?" }
* narration.choiceMenuOptions = [
* new ChoiceMenuOption("Events Test", eventsTestLabel),
* new ChoiceMenuOption("Show Image Test", showImageTest),
* ]
* },
* (props) => narration.jumpLabel(START_LABEL_ID, props),
* ]
* )
*
* narration.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>[];
getStepSha1(index: number): string;
}
export { Label as default };