123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <base href="../../../" />
- <script src="list.js"></script>
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- <h1>[name]</h1>
- <div class="desc">
- Handles and keeps track of loaded and pending data. A default global instance of this class
- is created and used by loaders if not supplied manually - see [page:DefaultLoadingManager].<br /><br />
- In general that should be sufficient, however there are times when it can be useful to have seperate loaders -
- for example if you want to show seperate loading bars for objects and textures.
- </div>
- <h2>Example</h2>
- <div>
- [example:webgl_loader_babylon WebGL / loader / babylon]<br />
- [example:webgl_loader_fbx WebGL / loader / fbx]<br />
- [example:webgl_loader_obj WebGL / loader / obj]<br />
- [example:webgl_materials_reflectivity WebGL / materials / reflectivity]<br />
- [example:webgl_postprocessing_outline WebGL / postprocesing / outline]<br />
- [example:webgl_terrain_dynamic WebGL / terrain / dynamic]
- </div>
- <code>
- var manager = new THREE.LoadingManager();
- manager.onStart = function ( url, itemsLoaded, itemsTotal ) {
- console.log( 'Started loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' );
- };
- manager.onLoad = function ( ) {
- console.log( 'Loading complete!');
- };
- manager.onProgress = function ( url, itemsLoaded, itemsTotal ) {
- console.log( 'Loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' );
- };
- manager.onError = function ( url ) {
- console.log( 'There was an error loading ' + url );
- };
- var loader = new THREE.OBJLoader( manager );
- loader.load( 'file.obj', function ( object ) {
- //
- } );
- </code>
- <h2>Constructor</h2>
- <h3>[name]( [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
- <div>
- [page:Function onLoad] — (optional) this function will be called when all loaders are done.<br />
- [page:Function onProgress] — (optional) this function will be called when an item is complete.<br />
- [page:Function onError] — (optional) this function will be called a loader encounters errors. <br />
- Creates a new [name].
- </div>
- <h2>Properties</h2>
- <h3>[property:Function onStart]</h3>
- <div>
- This function will be called when loading starts.
- The arguments are:<br />
- [page:String url] — The url of the item just loaded.<br />
- [page:Integer itemsLoaded] — the number of items already loaded so far.<br />
- [page:Iteger itemsTotal] — the total amount of items to be loaded.<br /><br />
- By default this is undefined.
- </div>
- <h3>[property:Function onLoad]</h3>
- <div>
- This function will be called when all loading is completed. By default this is undefined,
- unless passed in the constructor.
- </div>
- <h3>[property:Function onProgress]</h3>
- <div>
- This function will be called when an item is complete.
- The arguments are:<br />
- [page:String url] — The url of the item just loaded.<br />
- [page:Integer itemsLoaded] — the number of items already loaded so far.<br />
- [page:Iteger itemsTotal] — the total amount of items to be loaded.<br /><br />
- By default this is undefined, unless passed in the constructor.
- </div>
- <h3>[property:Function onError]</h3>
- <div>
- This function will be called when any item errors, with the argument:<br />
- [page:String url] — The url of the item that errored.<br /><br />
- By default this is undefined, unless passed in the constructor.
- </div>
- <h2>Methods</h2>
- <div>
- <em>Note: The following methods are designed to be called internally by loaders. You shouldn't call
- them directly.</em>
- </div>
- <h3>[method:null itemStart]( [page:String url] )</h3>
- <div>
- [page:String url] — the url to load<br /><br />
- This should be called by any loader used by the manager when the loader starts loading an url.
- </div>
- <h3>[method:null itemEnd]( [page:String url] )</h3>
- <div>
- [page:String url] — the loaded url<br /><br />
- This should be called by any loader used by the manager when the loader ended loading an url.
- </div>
- <h3>[method:null itemError]( [page:String url] )</h3>
- <div>
- [page:String url] — the loaded url<br /><br />
- This should be called by any loader used by the manager when the loader errors loading an url.
- </div>
- <h2>Source</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/src/loaders/LoadingManager.js src/loaders/LoadingManager.js]
- </body>
- </html>
|