Capítulo 166 de 859
A low level class for loading resources with the Fetch API, used internally by most loaders. It can also be used directly to load any file type that does not have a loader.
This loader supports caching. If you want to use it, add THREE.Cache.enabled = true; once to your application.
const loader = new THREE.FileLoader();
const data = await loader.loadAsync( 'example.txt' );
Constructor
| Signature |
|---|
new FileLoader( manager : LoadingManager ) |
Properties
| Property | Description |
|---|---|
.mimeType : string | The expected mime type. Valid values can be found here |
| `.responseType : 'arraybuffer' | 'blob' |
Methods
| Method | Description |
|---|---|
.abort() : FileLoader | Aborts ongoing fetch requests. |
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback ) | Starts loading from the given URL and pass the loaded response to the onLoad() callback. |
.setMimeType( value : string ) : FileLoader | Sets the expected mime type of the loaded file. |
| `.setResponseType( value : 'arraybuffer' | 'blob' |