SpriteMaterial.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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:Material] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">A material for a use with a [page:Sprite].</p>
  14. <h2>Examples</h2>
  15. <div>
  16. [example:webgl_sprites WebGL / sprites]<br />
  17. [example:misc_ubiquity_test misc / ubiquity / test]<br />
  18. [example:misc_ubiquity_test2 misc / ubiquity / test2]<br />
  19. [example:software_sandbox software / sandbox]<br />
  20. [example:svg_sandbox svg / sandbox]<br />
  21. [example:webgl_materials_cubemap_dynamic webgl / materials / cubemap / dynamic]
  22. </div>
  23. <code>
  24. var spriteMap = new THREE.TextureLoader().load( 'textures/sprite.png' );
  25. var spriteMaterial = new THREE.SpriteMaterial( { map: spriteMap, color: 0xffffff } );
  26. var sprite = new THREE.Sprite( spriteMaterial );
  27. sprite.scale.set(200, 200, 1)
  28. scene.add( sprite );
  29. </code>
  30. <h3>[name]( [param:Object parameters] )</h3>
  31. <p>
  32. [page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
  33. Any property of the material (including any property inherited from [page:Material]) can be passed in here.<br /><br />
  34. The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal
  35. string and is *0xffffff* (white) by default. [page:Color.set]( color ) is called internally.
  36. SpriteMaterials are not clipped by using [page:Material.clippingPlanes].
  37. </p>
  38. <h2>Properties</h2>
  39. <p>See the base [page:Material] class for common properties.</p>
  40. <h3>[property:Color color]</h3>
  41. <p>[page:Color] of the material, by default set to white (0xffffff). The [page:.map] is mutiplied by the color.</p>
  42. <h3>[property:boolean fog]</h3>
  43. <p>Whether or not this material affected by the scene's fog. Default is false</p>
  44. <h3>[property:Boolean lights]</h3>
  45. <p>Whether the material is affected by lights. Default is *false*.</p>
  46. <h3>[property:Texture map]</h3>
  47. <p>The texture map. Default is null.</p>
  48. <h3>[property:Radians rotation]</h3>
  49. <p>The rotation of the sprite in radians. Default is 0.</p>
  50. <h3>[property:Boolean sizeAttenuation]</h3>
  51. <p>Whether the size of the sprite is attenuated by the camera depth. (Perspective camera only.) Default is *true*.</p>
  52. <h2>Methods</h2>
  53. <p>See the base [page:Material] class for common methods.</p>
  54. <h2>Source</h2>
  55. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  56. </body>
  57. </html>