UNPKG

@drincs/pixi-vn

Version:

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

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