CanvasTexture.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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">
  32. <strong>canvas</strong>
  33. </td>
  34. <td class="description last">
  35. <p>The HTML canvas element.</p>
  36. </td>
  37. </tr>
  38. <tr>
  39. <td class="name">
  40. <strong>mapping</strong>
  41. </td>
  42. <td class="description last">
  43. <p>The texture mapping.</p>
  44. <p>Default is <code>Texture.DEFAULT_MAPPING</code>.</p>
  45. </td>
  46. </tr>
  47. <tr>
  48. <td class="name">
  49. <strong>wrapS</strong>
  50. </td>
  51. <td class="description last">
  52. <p>The wrapS value.</p>
  53. <p>Default is <code>ClampToEdgeWrapping</code>.</p>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td class="name">
  58. <strong>wrapT</strong>
  59. </td>
  60. <td class="description last">
  61. <p>The wrapT value.</p>
  62. <p>Default is <code>ClampToEdgeWrapping</code>.</p>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td class="name">
  67. <strong>magFilter</strong>
  68. </td>
  69. <td class="description last">
  70. <p>The mag filter value.</p>
  71. <p>Default is <code>LinearFilter</code>.</p>
  72. </td>
  73. </tr>
  74. <tr>
  75. <td class="name">
  76. <strong>minFilter</strong>
  77. </td>
  78. <td class="description last">
  79. <p>The min filter value.</p>
  80. <p>Default is <code>LinearMipmapLinearFilter</code>.</p>
  81. </td>
  82. </tr>
  83. <tr>
  84. <td class="name">
  85. <strong>format</strong>
  86. </td>
  87. <td class="description last">
  88. <p>The texture format.</p>
  89. <p>Default is <code>RGBAFormat</code>.</p>
  90. </td>
  91. </tr>
  92. <tr>
  93. <td class="name">
  94. <strong>type</strong>
  95. </td>
  96. <td class="description last">
  97. <p>The texture type.</p>
  98. <p>Default is <code>UnsignedByteType</code>.</p>
  99. </td>
  100. </tr>
  101. <tr>
  102. <td class="name">
  103. <strong>anisotropy</strong>
  104. </td>
  105. <td class="description last">
  106. <p>The anisotropy value.</p>
  107. <p>Default is <code>Texture.DEFAULT_ANISOTROPY</code>.</p>
  108. </td>
  109. </tr>
  110. </tbody>
  111. </table>
  112. </div>
  113. </div>
  114. <h2 class="subsection-title">Properties</h2>
  115. <div class="member">
  116. <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>
  117. <div class="description">
  118. <p>This flag can be used for type testing.</p>
  119. <p>Default is <code>true</code>.</p>
  120. </div>
  121. </div>
  122. <h2 class="subsection-title">Source</h2>
  123. <p>
  124. <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/CanvasTexture.js" translate="no" target="_blank" rel="noopener">src/textures/CanvasTexture.js</a>
  125. </p>
  126. </article>
  127. </section>
  128. <script src="../scripts/linenumber.js"></script>
  129. <script src="../scripts/page.js"></script>
  130. </body>
  131. </html>
粤ICP备19079148号