Sprite.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. [page:Object3D] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">A sprite is a plane in an 3d scene which faces always towards the camera.<br /><br />Sprites do not cast shadows, setting <code>castShadow = true</code> will have no effect.</div>
  14. <h2>Example</h2>
  15. <code>
  16. var map = new THREE.TextureLoader().load( "sprite.png" );
  17. var material = new THREE.SpriteMaterial( { map: map, color: 0xffffff, fog: true } );
  18. var sprite = new THREE.Sprite( material );
  19. scene.add( sprite );
  20. </code>
  21. <h2>Constructor</h2>
  22. <h3>[name]( [page:Material material] )</h3>
  23. <div>
  24. material — An instance of [page:Material] (optional).
  25. </div>
  26. <div>
  27. This creates a new sprite with an specific material.
  28. </div>
  29. <h2>Properties</h2>
  30. <h3>[property:SpriteMaterial material]</h3>
  31. <div>
  32. An instance of [page:Material], defining the object's appearance. Default is a [page:SpriteMaterial] which is a white plane.
  33. </div>
  34. <h2>Methods</h2>
  35. <h3>[method:Sprite clone]()</h3>
  36. <div>
  37. Returns a clone of this Sprite object and its descendants.
  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>