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