SpriteMaterial.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. <div class="desc">A material for a use with a [page:Sprite].</div>
  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]( [page:Object parameters] )</h3>
  31. <div>
  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. </div>
  37. <h2>Properties</h2>
  38. <div>See the base [page:Material] class for common properties.</div>
  39. <h3>[property:Color color]</h3>
  40. <div>[page:Color] of the material, by default set to white (0xffffff). The [page:.map] is mutiplied by the color.</div>
  41. <h3>[property:boolean fog]</h3>
  42. <div>Whether or not this material affected by the scene's fog. Default is false</div>
  43. <h3>[property:Boolean lights]</h3>
  44. <div>Whether the material is affected by lights. Default is *false*.</div>
  45. <h3>[property:Texture map]</h3>
  46. <div>The texture map. Default is null.</div>
  47. <h3>[property:Radians rotation]</h3>
  48. <div>The rotation of the sprite in radians. Default is 0.</div>
  49. <h2>Methods</h2>
  50. <div>See the base [page:Material] class for common methods.</div>
  51. <h2>Source</h2>
  52. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  53. </body>
  54. </html>