# SceneHandler

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

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

Resource handler for the `scene` asset type. Loads a PlayCanvas scene JSON file, instantiates
its entity hierarchy as the root of [AppBase#scene](https://api.playcanvas.com/engine/classes/AppBase.md#scene) and applies the scene's settings.

## Methods

### load

```ts
load(url: any, callback: 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.

### open

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

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).

**Returns** [`Scene`](https://api.playcanvas.com/engine/classes/Scene.md): The parsed resource data.

## 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`
- `patch(asset: Asset<string>, assets: AssetRegistry): void`
- `removeParser(parser: ResourceParser): void`
