UNPKG

@drincs/pixi-vn

Version:

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

42 lines (39 loc) 1.49 kB
import { Container } from 'pixi.js'; import ICanvasBaseMemory from '../../interface/canvas/ICanvasBaseMemory.js'; /** * This class is used to create a canvas element to add into a Pixi Application. * You can use GameWindowManager.addCanvasElement() to add this element into the application. * This class should be implemented and the memory method should be overridden. * You must use the {@link canvasElementDecorator} to register the canvas in the game. * In Ren'Py is a displayable. * @example * ```typescript * \@canvasElementDecorator() // this is equivalent to canvasElementDecorator("CanvasExample") * export class CanvasExample extends Container implements CanvasBase<ICanvasExampleMemory> { * get memory(): ICanvasExampleMemory { * return { * pixivnId: "CanvasExample", * // ... other properties * } * } * set memory(value: ICanvasExampleMemory) { * // ... set other properties * } * } * ``` */ declare class CanvasBase<T2 extends ICanvasBaseMemory> extends Container { /** * This method return the memory of the canvas element. */ get memory(): T2; /** * This method set the memory of the canvas element. */ set memory(_value: T2); /** * Get the id of the canvas element. This variable is used in the system to get the canvas element by id, {@link getCanvasElementInstanceById} */ pixivnId: string; } export { CanvasBase as default };