Sprite.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. <p class="desc">
  14. A sprite is a plane that always faces towards the camera, generally with a
  15. partially transparent texture applied.<br /><br />
  16. Sprites do not cast shadows, setting <code>castShadow = true</code> will have no effect.
  17. </p>
  18. <h2>Example</h2>
  19. <code>
  20. var spriteMap = new THREE.TextureLoader().load( "sprite.png" );
  21. var spriteMaterial = new THREE.SpriteMaterial( { map: spriteMap, color: 0xffffff } );
  22. var sprite = new THREE.Sprite( spriteMaterial );
  23. scene.add( sprite );
  24. </code>
  25. <h2>Constructor</h2>
  26. <h3>[name]( [param:Material material] )</h3>
  27. <p>
  28. [page:Material material] - (optional) an instance of [page:SpriteMaterial]. Default is a white [page:SpriteMaterial].<br /><br />
  29. Creates a new [name].
  30. </p>
  31. <h2>Properties</h2>
  32. <p>See the base [page:Object3D] class for common properties.</p>
  33. <h3>[property:Boolean isSprite]</h3>
  34. <p>
  35. Used to check whether this or derived classes are sprites. Default is *true*.<br /><br />
  36. You should not change this, as it used internally for optimisation.
  37. </p>
  38. <h3>[property:SpriteMaterial material]</h3>
  39. <p>
  40. An instance of [page:SpriteMaterial], defining the object's appearance.
  41. Default is a white [page:SpriteMaterial].
  42. </p>
  43. <h3>[property:Vector2 center]</h3>
  44. <p>
  45. The sprite's anchor point, and the point around which the sprite rotates. A value of (0.5, 0.5) corresponds to the midpoint of the sprite.
  46. A value of (0, 0) corresponds to the lower left corner of the sprite. The default is (0.5, 0.5).
  47. </p>
  48. <h2>Methods</h2>
  49. <p>See the base [page:Object3D] class for common methods.</p>
  50. <h3>[method:Sprite clone]()</h3>
  51. <p>
  52. Returns a clone of this Sprite object and any descendants.
  53. </p>
  54. <h3>[method:Sprite copy]( [param:Sprite sprite] )</h3>
  55. <p>
  56. Copies the properties of the passed sprite to this one.
  57. </p>
  58. <h3>[method:null raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
  59. <p>
  60. Get intersections between a casted ray and this sprite.
  61. [page:Raycaster.intersectObject] will call this method.
  62. </p>
  63. <h2>Source</h2>
  64. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  65. </body>
  66. </html>