SpriteCanvasMaterial.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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">Create a material that can draw custom sprites using a 2d canvas.</p>
  14. <h2>Constructor</h2>
  15. <h3>[name]( [param:Object parameters] )</h3>
  16. <p>
  17. parameters is an object that can be used to set up the default properties
  18. </p>
  19. <p>
  20. rotation - the rotation of the sprite<br/>
  21. color - the color of the sprite<br/>
  22. program - the program used to draw the sprite
  23. </p>
  24. <h2>Properties</h2>
  25. <h3>[property:Radians rotation]</h3>
  26. <p>
  27. The rotation of the sprite in radians. Default is 0.
  28. </p>
  29. <h3>[property:Color color]</h3>
  30. <p>
  31. The color of the sprite. The material will set up the color for the context before calling the material's program.
  32. </p>
  33. <h2>Methods</h2>
  34. <h3>[method:null program]([param:CanvasRenderingContext2D context], [param:Color color])</h3>
  35. <p>
  36. context -- The canvas context <br />
  37. color -- The color of the sprite
  38. </p>
  39. <p>
  40. Define a program that will use the context to draw the sprite.
  41. </p>
  42. <h2>Source</h2>
  43. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js examples/js/renderers/CanvasRenderer.js]
  44. </body>
  45. </html>