1
0

module-Text2D.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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">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"><code>message</code></td>
  34. <td class="description last"><p>The message to display.</p></td>
  35. </tr>
  36. <tr>
  37. <td class="name"><code>height</code></td>
  38. <td class="description last"><p>The labels height.</p></td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. <dl class="details">
  43. <dt class="tag-returns"><strong>Returns:</strong> The plane mesh representing a text label.</dt>
  44. </dl>
  45. </div>
  46. <h2 class="subsection-title">Source</h2>
  47. <p>
  48. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/webxr/Text2D.js" target="_blank" rel="noopener" translate="no">examples/jsm/webxr/Text2D.js</a>
  49. </p>
  50. </article>
  51. </section>
  52. <script src="../scripts/linenumber.js"></script>
  53. <script src="../scripts/page.js"></script>
  54. </body>
  55. </html>
粤ICP备19079148号