module-Text2D.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Text2D - 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. <h1 translate="no">Text2D</h1>
  13. <section>
  14. <header>
  15. </header>
  16. <article>
  17. <h2 class="subsection-title">Import</h2>
  18. <p><span translate="no">Text2D</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  19. <pre><code class="language-js">import * as Text2D from 'three/addons/webxr/Text2D.js';</code></pre>
  20. <div class="container-overview">
  21. </div>
  22. <h2 class="subsection-title">Methods</h2>
  23. <h3 class="name name-method" id="~createText" translate="no">.<a href="#~createText">createText</a><span class="signature">( message : <span class="param-type">string</span>, height : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Mesh.html">Mesh</a></span> <span class="type-signature">(inner) </span></h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>A helper function for creating a simple plane mesh
  27. that can be used as a text label. The mesh's material
  28. holds a canvas texture that displays the given message.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong>message</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The message to display.</p>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="name">
  42. <strong>height</strong>
  43. </td>
  44. <td class="description last">
  45. <p>The labels height.</p>
  46. </td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. <dl class="details">
  51. <dt class="tag-returns"><strong>Returns:</strong> The plane mesh representing a text label.</dt>
  52. </dl>
  53. </div>
  54. <h2 class="subsection-title">Source</h2>
  55. <p>
  56. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/webxr/Text2D.js" translate="no" target="_blank" rel="noopener">examples/jsm/webxr/Text2D.js</a>
  57. </p>
  58. </article>
  59. </section>
  60. <script src="../scripts/linenumber.js"></script>
  61. <script src="../scripts/page.js"></script>
  62. </body>
  63. </html>
粤ICP备19079148号