CanvasTexture.html 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CanvasTexture - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Texture.html">Texture</a> → </p>
  13. <h1 translate="no">CanvasTexture</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Creates a texture from a canvas element.</p>
  17. <p>This is almost the same as the base texture class, except that it sets <a href="Texture.html#needsUpdate">Texture#needsUpdate</a>
  18. to <code>true</code> immediately since a canvas can directly be used for rendering.</p></div>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <h2>Constructor</h2>
  23. <h3 class="name name-method" id="CanvasTexture" translate="no">new <a href="#CanvasTexture">CanvasTexture</a><span class="signature">( canvas : <span class="param-type">HTMLCanvasElement</span>, mapping : <span class="param-type">number</span>, wrapS : <span class="param-type">number</span>, wrapT : <span class="param-type">number</span>, magFilter : <span class="param-type">number</span>, minFilter : <span class="param-type">number</span>, format : <span class="param-type">number</span>, type : <span class="param-type">number</span>, anisotropy : <span class="param-type">number</span> )</span> </h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Constructs a new texture.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name"><code>canvas</code></td>
  32. <td class="description last"><p>The HTML canvas element.</p></td>
  33. </tr>
  34. <tr>
  35. <td class="name"><code>mapping</code></td>
  36. <td class="description last"><p>The texture mapping.<br/>Default is <code>Texture.DEFAULT_MAPPING</code>.</p></td>
  37. </tr>
  38. <tr>
  39. <td class="name"><code>wrapS</code></td>
  40. <td class="description last"><p>The wrapS value.<br/>Default is <code>ClampToEdgeWrapping</code>.</p></td>
  41. </tr>
  42. <tr>
  43. <td class="name"><code>wrapT</code></td>
  44. <td class="description last"><p>The wrapT value.<br/>Default is <code>ClampToEdgeWrapping</code>.</p></td>
  45. </tr>
  46. <tr>
  47. <td class="name"><code>magFilter</code></td>
  48. <td class="description last"><p>The mag filter value.<br/>Default is <code>LinearFilter</code>.</p></td>
  49. </tr>
  50. <tr>
  51. <td class="name"><code>minFilter</code></td>
  52. <td class="description last"><p>The min filter value.<br/>Default is <code>LinearMipmapLinearFilter</code>.</p></td>
  53. </tr>
  54. <tr>
  55. <td class="name"><code>format</code></td>
  56. <td class="description last"><p>The texture format.<br/>Default is <code>RGBAFormat</code>.</p></td>
  57. </tr>
  58. <tr>
  59. <td class="name"><code>type</code></td>
  60. <td class="description last"><p>The texture type.<br/>Default is <code>UnsignedByteType</code>.</p></td>
  61. </tr>
  62. <tr>
  63. <td class="name"><code>anisotropy</code></td>
  64. <td class="description last"><p>The anisotropy value.<br/>Default is <code>Texture.DEFAULT_ANISOTROPY</code>.</p></td>
  65. </tr>
  66. </tbody>
  67. </table>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Properties</h2>
  71. <div class="member">
  72. <h3 class="name" id="isCanvasTexture" translate="no">.<a href="#isCanvasTexture">isCanvasTexture</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  73. <div class="description">
  74. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  75. </div>
  76. </div>
  77. <h2 class="subsection-title">Source</h2>
  78. <p>
  79. <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/CanvasTexture.js" target="_blank" rel="noopener" translate="no">src/textures/CanvasTexture.js</a>
  80. </p>
  81. </article>
  82. </section>
  83. <script src="../scripts/linenumber.js"></script>
  84. <script src="../scripts/page.js"></script>
  85. </body>
  86. </html>
粤ICP备19079148号