DefaultLoadingManager.html 2.1 KB

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