Sprite.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. </div>
  14. <h2>Example</h2>
  15. <code>
  16. var map = THREE.ImageUtils.loadTexture( "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. -
  35. <h2>Methods</h2>
  36. <h3>[method:Sprite clone]()</h3>
  37. <div>
  38. This creates a new clone of the sprite.
  39. </div>
  40. <h3>[method:Object3D clone]([page:Object3D object])</h3>
  41. <div>
  42. object -- (optional) Object3D which needs to be cloned. If undefined, clone method will create a new cloned Sprite Object.
  43. </div>
  44. <div>
  45. Clone a Sprite Object.
  46. </div>
  47. <h2>Source</h2>
  48. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  49. </body>
  50. </html>