# CubemapHandler

Class · extends [`ResourceHandler`](https://api.playcanvas.com/engine/classes/ResourceHandler.md) · category: Asset

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/framework/handlers/cubemap.js#L33

Resource handler for the `cubemap` asset type. Assembles a cube map [Texture](https://api.playcanvas.com/engine/classes/Texture.md) from six
face texture assets, from a prefiltered environment file, or both, and stores the results in
[Asset#resources](https://api.playcanvas.com/engine/classes/Asset.md#resources).

## Methods

### load

```ts
load(url: any, callback: any, asset: any): void
```

Load a resource from a remote URL. When parsers are registered, the matching parser's `load` is
used; otherwise the base implementation does nothing (subclasses may override).

**Parameters**

- `url` (`any`): Either the URL of the resource to
  load or a structure containing the load URL (used for loading the resource) and the original
  URL (used for identifying the resource format; necessary when loading, for example, from
  a blob URL).
- `callback` (`any`): The callback used when the resource is loaded or
  an error occurs.
- `asset` (`any`): Optional asset that is passed by ResourceLoader.

### open

```ts
open(url: any, data: any, asset: any): any
```

The open function is passed the raw resource data. The handler can then process the data
into a format that can be used at runtime. When parsers are registered, the matching parser's
`open` is used (if it implements one); otherwise the base implementation simply returns the data.

**Parameters**

- `url` (`any`): The URL of the resource to open.
- `data` (`any`): The raw resource data passed by callback from [load](https://api.playcanvas.com/engine/classes/ResourceHandler.md#load).
- `asset` (`any`): Optional asset that is passed by ResourceLoader.

**Returns** `any`: The parsed resource data.

### patch

```ts
patch(asset: any, registry: any): void
```

The patch function performs any operations on a resource that requires a dependency on its
asset data or any other asset data. The base implementation does nothing.

**Parameters**

- `asset` (`any`): The asset to patch.
- `registry` (`any`)

## Inherited from [ResourceHandler](https://api.playcanvas.com/engine/classes/ResourceHandler.md)

- `protected _app: AppBase`
- `handlerType: string = ''`
- `get app(): AppBase`
- `get maxRetries(): number` · `set maxRetries(value: number)`
- `get parsers(): ResourceParser[]`
- `addParser(parser: ResourceParser, decider?: any): void`
- `fetch(url: string | { load: string; original: string }, responseType: string, callback: ResourceHandlerCallback, asset?: Asset<string>): void`
- `removeParser(parser: ResourceParser): void`
