Sprite.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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">
  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. </div>
  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]( [page:Material material] )</h3>
  27. <div>
  28. [page:Material material] - (optional) an instance of [page:SpriteMaterial]. Default is a white [page:SpriteMaterial].<br /><br />
  29. Creates a new [name].
  30. </div>
  31. <h2>Properties</h2>
  32. <div>See the base [page:Object3D] class for common properties.</div>
  33. <h3>[property:Boolean isSprite]</h3>
  34. <div>
  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. </div>
  38. <h3>[property:SpriteMaterial material]</h3>
  39. <div>
  40. An instance of [page:SpriteMaterial], defining the object's appearance.
  41. Default is a white [page:SpriteMaterial].
  42. </div>
  43. <h3>[property:Vector2 center]</h3>
  44. <div>
  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. </div>
  48. <h2>Methods</h2>
  49. <div>See the base [page:Object3D] class for common methods.</div>
  50. <h3>[method:Sprite clone]()</h3>
  51. <div>
  52. Returns a clone of this Sprite object and any descendants.
  53. </div>
  54. <h3>[method:Array raycast]( [page:Raycaster raycaster], [page:Array intersects] )</h3>
  55. <div>
  56. Get intersections between a casted ray and this sprite.
  57. [page:Raycaster.intersectObject] will call this method.
  58. </div>
  59. <h2>Source</h2>
  60. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  61. </body>
  62. </html>