1 | import { AbstractMultiResource } from './AbstractMultiResource';
|
2 | import type { ISize } from '@pixi/math';
|
3 | import type { ArrayFixed } from '@pixi/utils';
|
4 | import type { Renderer } from '../../Renderer';
|
5 | import type { BaseTexture } from '../BaseTexture';
|
6 | import type { GLTexture } from '../GLTexture';
|
7 | import type { Resource } from './Resource';
|
8 | /**
|
9 | * Constructor options for CubeResource.
|
10 | * @memberof PIXI
|
11 | */
|
12 | export interface ICubeResourceOptions extends ISize {
|
13 | /** Whether to auto-load resources */
|
14 | autoLoad?: boolean;
|
15 | /** In case BaseTextures are supplied, whether to copy them or use. */
|
16 | linkBaseTexture?: boolean;
|
17 | }
|
18 | /**
|
19 | * Resource for a CubeTexture which contains six resources.
|
20 | * @memberof PIXI
|
21 | */
|
22 | export declare class CubeResource extends AbstractMultiResource {
|
23 | items: ArrayFixed<BaseTexture, 6>;
|
24 | /**
|
25 | * In case BaseTextures are supplied, whether to use same resource or bind baseTexture itself.
|
26 | * @protected
|
27 | */
|
28 | linkBaseTexture: boolean;
|
29 | /**
|
30 | * @param {Array<string|PIXI.Resource>} [source] - Collection of URLs or resources
|
31 | * to use as the sides of the cube.
|
32 | * @param options - ImageResource options
|
33 | * @param {number} [options.width] - Width of resource
|
34 | * @param {number} [options.height] - Height of resource
|
35 | * @param {number} [options.autoLoad=true] - Whether to auto-load resources
|
36 | * @param {number} [options.linkBaseTexture=true] - In case BaseTextures are supplied,
|
37 | * whether to copy them or use
|
38 | */
|
39 | constructor(source?: ArrayFixed<string | Resource, 6>, options?: ICubeResourceOptions);
|
40 | /**
|
41 | * Add binding.
|
42 | * @param baseTexture - parent base texture
|
43 | */
|
44 | bind(baseTexture: BaseTexture): void;
|
45 | addBaseTextureAt(baseTexture: BaseTexture, index: number, linkBaseTexture?: boolean): this;
|
46 | /**
|
47 | * Upload the resource
|
48 | * @param renderer
|
49 | * @param _baseTexture
|
50 | * @param glTexture
|
51 | * @returns {boolean} true is success
|
52 | */
|
53 | upload(renderer: Renderer, _baseTexture: BaseTexture, glTexture: GLTexture): boolean;
|
54 | /** Number of texture sides to store for CubeResources. */
|
55 | static SIDES: number;
|
56 | /**
|
57 | * Used to auto-detect the type of resource.
|
58 | * @param {*} source - The source object
|
59 | * @returns {boolean} `true` if source is an array of 6 elements
|
60 | */
|
61 | static test(source: unknown): source is ArrayFixed<string | Resource, 6>;
|
62 | }
|