UNPKG

1.5 kBTypeScriptView Raw
1import { AbstractMultiResource } from './AbstractMultiResource';
2import type { ISize } from '@pixi/math';
3import type { Renderer } from '../../Renderer';
4import type { BaseTexture } from '../BaseTexture';
5import type { GLTexture } from '../GLTexture';
6/**
7 * A resource that contains a number of sources.
8 * @memberof PIXI
9 */
10export declare class ArrayResource extends AbstractMultiResource {
11 /**
12 * @param source - Number of items in array or the collection
13 * of image URLs to use. Can also be resources, image elements, canvas, etc.
14 * @param options - Options to apply to {@link PIXI.autoDetectResource}
15 * @param {number} [options.width] - Width of the resource
16 * @param {number} [options.height] - Height of the resource
17 */
18 constructor(source: number | Array<any>, options?: ISize);
19 /**
20 * Set a baseTexture by ID,
21 * ArrayResource just takes resource from it, nothing more
22 * @param baseTexture
23 * @param index - Zero-based index of resource to set
24 * @returns - Instance for chaining
25 */
26 addBaseTextureAt(baseTexture: BaseTexture, index: number): this;
27 /**
28 * Add binding
29 * @param baseTexture
30 */
31 bind(baseTexture: BaseTexture): void;
32 /**
33 * Upload the resources to the GPU.
34 * @param renderer
35 * @param texture
36 * @param glTexture
37 * @returns - whether texture was uploaded
38 */
39 upload(renderer: Renderer, texture: BaseTexture, glTexture: GLTexture): boolean;
40}