DefaultLoadingManager.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. <h1>[name]</h1>
  12. <p class="desc">A global instance of the [page:LoadingManager LoadingManager], used by most loaders
  13. when no custom manager has been specified.<br /><br />
  14. This will be sufficient for most purposes, however there may be times when you desire seperate loading managers
  15. for say, textures and models.
  16. </p>
  17. <h2>Code Example</h2>
  18. <p>
  19. You can optionally set the [page:LoadingManager.onStart onStart], [page:LoadingManager.onLoad onLoad],
  20. [page:LoadingManager.onProgress onProgress], [page:LoadingManager.onStart onError] functions for the manager.
  21. These will then apply to any loaders using the DefaultLoadingManager.<br /><br />
  22. Note that these shouldn't be confused with the similarly named functions of individual loaders,
  23. as they are intended for displaying information about the overall status of loading,
  24. rather than dealing with the data that has been loaded.
  25. </p>
  26. <code>
  27. THREE.DefaultLoadingManager.onStart = function ( url, itemsLoaded, itemsTotal ) {
  28. console.log( 'Started loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' );
  29. };
  30. THREE.DefaultLoadingManager.onLoad = function ( ) {
  31. console.log( 'Loading Complete!');
  32. };
  33. THREE.DefaultLoadingManager.onProgress = function ( url, itemsLoaded, itemsTotal ) {
  34. console.log( 'Loading file: ' + url + '.\nLoaded ' + itemsLoaded + ' of ' + itemsTotal + ' files.' );
  35. };
  36. THREE.DefaultLoadingManager.onError = function ( url ) {
  37. console.log( 'There was an error loading ' + url );
  38. };
  39. </code>
  40. <h2>Properties</h2>
  41. <p>See the [page:LoadingManager LoadingManager] page for details of properties.</p>
  42. <h2>Methods</h2>
  43. <p>See the [page:LoadingManager LoadingManager] page for details of methods.</p>
  44. <h2>Source</h2>
  45. [link:https://github.com/mrdoob/three.js/blob/master/src/loaders/LoadingManager.js src/loaders/LoadingManager.js]
  46. </body>
  47. </html>