UNPKG

@drincs/pixi-vn

Version:

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

55 lines (52 loc) 2.48 kB
import { ImageSpriteOptions } from '../../interface/canvas/canvas-options.js'; import ImageSprite from '../../classes/canvas/ImageSprite.js'; import 'pixi.js'; import '../../classes/canvas/AdditionalPositions.js'; import '../../classes/canvas/AnchorExtension.js'; import '../../types/ContainerChild.js'; import '../../classes/canvas/CanvasBaseItem.js'; import '../../interface/canvas/memory/CanvasBaseItemMemory.js'; import '../../classes/canvas/Sprite.js'; import '../../types/CanvasEventNamesType.js'; import '../../classes/CanvasEvent.js'; import '../../types/EventIdType.js'; import '../../interface/canvas/memory/SpriteMemory.js'; import '../../interface/canvas/TextureMemory.js'; import '../../interface/canvas/memory/ImageSpriteMemory.js'; /** * Add a image in the canvas. * Is the same that {@link showImage}, but the image is not shown. * If you want to show the image, then you need to use the function {@link ImageSprite.load()}. * @param alias is the unique alias of the image. You can use this alias to refer to this image * @param imageUrl is the url of the image. If you don't provide the url, then the alias is used as the url. * @param options The options of the image. * @returns the container of the image. * @example * ```typescript * let bunny1 = addImage("bunny1", "https://pixijs.com/assets/bunny1.png") * await bunny1.load() * Assets.add({ alias: "bunny2", src: "https://pixijs.com/assets/bunny2.png" }) * let bunny2 = addImage("bunny2") * await bunny2.load() * ``` */ declare function addImage(alias: string, imageUrl?: string, options?: ImageSpriteOptions): ImageSprite; /** * @deprecated */ declare function loadImage(canvasImages: ImageSprite[] | ImageSprite): Promise<ImageSprite[]>; /** * Add and show a image in the canvas. This function is a combination of {@link addImage} and {@link loadImage}. * @param alias The unique alias of the image. You can use this alias to refer to this image * @param imageUrl The url of the image. * @param options The options of the image. * @returns A promise that is resolved when the image is loaded. * @example * ```typescript * let bunny1 = showImage("bunny1", "https://pixijs.com/assets/bunny1.png") * Assets.add({ alias: "bunny2", src: "https://pixijs.com/assets/bunny2.png" }) * let bunny2 = showImage("bunny2") * ``` */ declare function showImage(alias: string, imageUrl?: string, options?: ImageSpriteOptions): Promise<ImageSprite>; export { addImage, loadImage, showImage };