LoadingManager.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  6. <script src="../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <div class="desc">Handles and keeps track of loaded and pending data.</div>
  12. <code>
  13. var manager = new THREE.LoadingManager();
  14. manager.onProgress = function ( item, loaded, total ) {
  15. console.log( item, loaded, total );
  16. };
  17. var loader = new THREE.OBJLoader( manager );
  18. loader.load( 'file.obj', function ( object ) {
  19. //
  20. } );
  21. </code>
  22. <h2>Constructor</h2>
  23. <h3>[name]([page:function onLoad], [page:function onProgress], [page:function onError])</h3>
  24. <div>
  25. [page:function onLoad] -- The function that needs to be called when all loaders are done.
  26. [page:function onProgress] -- The function that needs to be called when an item is complete.
  27. [page:function onError] -- The function that needs to be called when an item is errors.
  28. </div>
  29. <div>
  30. Creates a [name].
  31. </div>
  32. <h2>Properties</h2>
  33. <h3>[property:function onLoad]</h3>
  34. <div>
  35. The function that needs to be called when all loaders are done.
  36. </div>
  37. <h3>[property:function onProgress]</h3>
  38. <div>
  39. The function that needs to be called when an item is complete. The arguments are url(The url of the item just loaded),<br />
  40. loaded(the amount of items already loaded), total( The total amount of items to be loaded.)
  41. </div>
  42. <h3>[property:function onError]</h3>
  43. <div>
  44. The function that needs to be called when an item errors.
  45. </div>
  46. <h2>Methods</h2>
  47. <h3>[method:todo itemStart]( [page:String url] )</h3>
  48. <div>
  49. url — the url to load
  50. </div>
  51. <div>
  52. This should be called by any loader used by the manager when the loader starts loading an url. These shouldn't be called outside a loader.
  53. </div>
  54. <h3>[method:todo itemEnd]( [page:String url] )</h3>
  55. <div>
  56. url — the url to load
  57. </div>
  58. <div>
  59. This should be called by any loader used by the manager when the loader ended loading an url. These shouldn't be called outside a loader.
  60. </div>
  61. <h2>Source</h2>
  62. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  63. </body>
  64. </html>