dcl-npc-toolkit
Version:
A collection of tools for creating Non-Player-Characters (NPCs). These are capable of having conversations with the player, and play different animations.
86 lines (85 loc) • 3.69 kB
TypeScript
import { Entity } from "@dcl/sdk/ecs";
import { Dialog, ImageData } from "./types";
import { Color4 } from '@dcl/sdk/math';
export declare const npcDialogComponent: Map<Entity, any>;
export declare const npcDialogTypingSystems: Map<Entity, any>;
export declare const npcDialogInputListener: Map<Entity, any>;
export declare enum ConfirmMode {
Confirm = 0,
Cancel = 1,
Next = 2,
Button3 = 3,
Button4 = 4
}
export declare let UIscaleMultiplier: number;
export declare function addDialog(npc: Entity, sound?: string, defaultPortrait?: ImageData): void;
export declare function displayImage(): any;
export declare function displayPortrait(): any;
export declare function displaySkipable(): any;
export declare function getSkipableTheme(): {
atlasHeight: number;
atlasWidth: number;
sourceWidth: number;
sourceHeight: number;
sourceLeft: number;
sourceTop: number;
};
export declare function getLeftClickTheme(): {
atlasHeight: number;
atlasWidth: number;
sourceWidth: number;
sourceHeight: number;
sourceLeft: number;
sourceTop: number;
};
export declare function positionTextX(): any;
export declare function positionTextY(): any;
export declare function positionPortaitX(): any;
export declare function positionPortaitY(): any;
export declare function portraitWidth(): any;
export declare function portraitHeight(): any;
export declare function positionImageX(): any;
export declare function positionImageY(): any;
export declare function imageWidth(): any;
export declare function imageHeight(): any;
export declare function getPortrait(): any;
export declare function getImage(): any;
export declare function getText(): any;
export declare function getTextColor(): Color4.MutableColor4;
export declare function getTheme(): any;
export declare function getButtonText(button: number): string;
export declare function getbuttonSize(button: number): string | number | undefined;
export declare function getFontSize(): any;
export declare function getButtonFontSize(button: number): number;
export declare function displayDialog(): any;
export declare function getWindowHeight(): string | number | undefined;
export declare function displayButton(button: number): any;
export declare function displayFirstButtonContainer(): any;
export declare function displaySecondButtonContainer(): any;
export declare function getTextPosition(): {
top: any;
left: any;
};
export declare function buttonClick(button: number): void;
export declare function closeDialog(npc: Entity): void;
export declare function talk(npc: Entity, dialog: Dialog[], startIndex?: number | string, duration?: number): void;
export declare function openDialog(npc: Entity, dialog: Dialog[], startIndex: number): void;
export declare function addLineBreak(text: string, bubble?: boolean): string;
export declare function addLineBreaks(dialog: Dialog[], bubble?: boolean): Dialog[];
export declare function handleDialogClick(): void;
export declare function rushText(npc: Entity): void;
export declare function confirmText(npc: Entity, mode: ConfirmMode): void;
export declare function skipDialogs(npc: Entity): void;
export type ImageAtlasData = {
atlasWidth: number;
atlasHeight: number;
sourceWidth: number;
sourceHeight: number;
sourceLeft: number;
sourceTop: number;
};
export declare function getImageAtlasMapping(data?: ImageAtlasData): number[];
export declare function realWidth(width?: number): number;
export declare function realHeight(height?: number): number;
export declare function findDialogByName(dialogs: Dialog[], name: string): number;
export declare function closeTag(dialogData: any, newChars: number): void;