UNPKG

@drincs/pixi-vn

Version:

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

34 lines (31 loc) 1.5 kB
import { Container, ContainerOptions } from 'pixi.js'; import ICanvasContainerMemory from '../../interface/canvas/ICanvasContainerMemory.js'; import CanvasBase from './CanvasBase.js'; import '../../interface/canvas/ICanvasBaseMemory.js'; declare const CANVAS_CONTAINER_ID = "CanvasContainer"; /** * This class is a extension of the [PIXI.Container class](https://pixijs.com/8.x/examples/basic/container), it has the same properties and methods, * but it has the ability to be saved and loaded by the Pixi'VN library. * @example * ```typescript * const container = new CanvasContainer(); * GameWindowManager.addCanvasElement(container); * const texture = await Assets.load('https://pixijs.com/assets/bunny.png'); * for (let i = 0; i < 25; i++) * { * const bunny = new CanvasSprite(texture); * bunny.x = (i % 5) * 40; * bunny.y = Math.floor(i / 5) * 40; * container.addChild(bunny); * } * ``` */ declare class CanvasContainer extends Container implements CanvasBase<ICanvasContainerMemory> { constructor(options?: ContainerOptions); pixivnId: string; get memory(): ICanvasContainerMemory; set memory(value: ICanvasContainerMemory); } declare function getMemoryContainer<T extends Container>(element: T): ICanvasContainerMemory; declare function setMemoryContainer<T extends Container>(element: T | Container, memory: ContainerOptions): void; export { CANVAS_CONTAINER_ID, CanvasContainer as default, getMemoryContainer, setMemoryContainer };