@drincs/pixi-vn
Version:
Pixi'VN is a npm package that provides various features for creating visual novels.
100 lines (97 loc) • 3.71 kB
TypeScript
import * as pixi_js from 'pixi.js';
import { Application, Container, ApplicationOptions } from 'pixi.js';
import { Devtools } from '@pixi/devtools';
import PauseTickerType from '../types/PauseTickerType.js';
import TickerHistory from '../interface/TickerHistory.js';
import TickersSequence from '../interface/TickersSequence.js';
import TickerTimeoutHistory from '../interface/TickerTimeoutHistory.js';
import '../types/TickerIdType.js';
import '../interface/TickerArgs.js';
import '../types/PauseType.js';
import '../types/RepeatType.js';
/**
* 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(): {
[]: TickerHistory<any>;
};
static _currentTickers: {
[]: TickerHistory<any>;
};
static _currentTickersSequence: {
[]: {
[]: TickersSequence;
};
};
static _currentTickersTimeouts: {
[]: TickerTimeoutHistory;
};
static _tickersToCompleteOnStepEnd: {
tikersIds: {
id: string;
}[];
stepAlias: {
id: string;
alias: string;
}[];
};
static _tickersOnPause: {
[]: 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 };