Sprite.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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>.[page: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>.clone()</h3>
  36. <div>
  37. This creates a new clone of the sprite.
  38. </div>
  39. <h2>Source</h2>
  40. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  41. </body>
  42. </html>