SpriteCanvasMaterial.html 1.3 KB

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