Sprite.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. [page:Object3D] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">A sprite is a plane in an 3d scene which faces always towards the camera. </div>
  13. <h2>Example</h2>
  14. <code>
  15. var map = THREE.ImageUtils.loadTexture( "sprite.png" );
  16. var material = new THREE.SpriteMaterial( { map: map, color: 0xffffff, fog: true } );
  17. var sprite = new THREE.Sprite( material );
  18. scene.add( sprite );
  19. </code>
  20. <h2>Constructor</h2>
  21. <h3>[name]([page:Material material])</h3>
  22. <div>
  23. material — An instance of [page:Material] (optional).
  24. </div>
  25. <div>
  26. This creates a new sprite with an specific material.
  27. </div>
  28. <h2>Properties</h2>
  29. <h3>[property:SpriteMaterial material]</h3>
  30. <div>
  31. An instance of [page:Material], defining the object's appearance. Default is a [page:SpriteMaterial] which is a white plane.
  32. </div>
  33. -
  34. <h2>Methods</h2>
  35. <h3>[method:Sprite clone]()</h3>
  36. <div>
  37. This creates a new clone of the sprite.
  38. </div>
  39. <h3>[method:Object3D clone]([page:Object3D object])</h3>
  40. <div>
  41. object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned Sprite Object.
  42. </div>
  43. <div>
  44. Clone a Sprite Object.
  45. </div>
  46. <h2>Source</h2>
  47. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  48. </body>
  49. </html>