UNPKG

@drincs/pixi-vn

Version:

Pixi'VN is a npm package that provides various features for creating visual novels.

100 lines (97 loc) 3.72 kB
import * as pixi_js from 'pixi.js'; import { Application, Container, ApplicationOptions } from 'pixi.js'; import { Devtools } from '@pixi/devtools'; import PauseTickerType from '../types/PauseTickerType.cjs'; import TickerHistory from '../interface/TickerHistory.cjs'; import TickersSequence from '../interface/TickersSequence.cjs'; import TickerTimeoutHistory from '../interface/TickerTimeoutHistory.cjs'; import '../types/TickerIdType.cjs'; import '../interface/TickerArgs.cjs'; import '../types/PauseType.cjs'; import '../types/RepeatType.cjs'; /** * This class is responsible for managing the canvas, the tickers, the events, and the window size and the children of the window. */ declare class CanvasManagerStatic { private constructor(); private static _app; static get app(): Application<pixi_js.Renderer>; static get gameLayer(): Container<pixi_js.ContainerChild>; /** * This is the div that have same size of the canvas. * This is useful to put interface elements. * You can use React or other framework to put elements in this div. */ static htmlLayout?: HTMLElement; static canvasWidth: number; static canvasHeight: number; static _isInitialized: boolean; static initialize(element: HTMLElement, width: number, height: number, options?: Partial<ApplicationOptions>, devtoolsOptions?: Devtools): Promise<void>; /** * Add the canvas into a html element. * @param element it is the html element where I will put the canvas. Example: document.body */ private static addCanvasIntoHTMLElement; static initializeHTMLLayout(element: HTMLElement): void; /** * This method returns the scale of the screen. */ private static get screenScale(); /** * This method returns the width of the screen enlarged by the scale. */ private static get screenWidth(); /** * This method returns the height of the screen enlarged by the scale. */ private static get screenHeight(); /** * This method returns the horizontal margin of the screen. */ private static get horizontalMargin(); /** * This method returns the vertical margin of the screen. */ private static get verticalMargin(); /** * This method is called when the screen is resized. */ private static resize; /** * The order of the elements in the canvas, is determined by the zIndex. */ static get childrenAliasesOrder(): string[]; /** Edit Tickers Methods */ static get currentTickersWithoutCreatedBySteps(): { [k: string]: TickerHistory<any>; }; static _currentTickers: { [id: string]: TickerHistory<any>; }; static _currentTickersSequence: { [alias: string]: { [tickerId: string]: TickersSequence; }; }; static _currentTickersTimeouts: { [timeout: string]: TickerTimeoutHistory; }; static _tickersToCompleteOnStepEnd: { tikersIds: { id: string; }[]; stepAlias: { id: string; alias: string; }[]; }; static _tickersOnPause: { [aliasOrId: string]: PauseTickerType; }; static generateTickerId(tickerData: TickerHistory<any> | TickersSequence): string; static addTickerTimeoutInfo(aliases: string | string[], ticker: string, timeout: string, canBeDeletedBeforeEnd: boolean): void; static removeTickerTimeoutInfo(timeout: NodeJS.Timeout | string): void; static removeTickerTimeout(timeout: NodeJS.Timeout | string): void; static removeTickerTimeoutsByAlias(alias: string, checkCanBeDeletedBeforeEnd: boolean): void; } export { CanvasManagerStatic as default };