1
0

CSS2DObject.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CSS2DObject - 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="Object3D.html">Object3D</a> → </p>
  13. <h1 translate="no">CSS2DObject</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>The only type of 3D object that is supported by <a href="CSS2DRenderer.html">CSS2DRenderer</a>.</p></div>
  17. </header>
  18. <article>
  19. <h2 class="subsection-title">Import</h2>
  20. <p><span translate="no">CSS2DObject</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>
  21. <pre><code class="language-js">import { CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js';</code></pre>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="CSS2DObject" translate="no">new <a href="#CSS2DObject">CSS2DObject</a><span class="signature">( element : <span class="param-type">HTMLElement</span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new CSS2D object.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>element</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The DOM element.</p>
  37. </td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. <h2 class="subsection-title">Properties</h2>
  44. <div class="member">
  45. <h3 class="name" id="center" translate="no">.<a href="#center">center</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  46. <div class="description">
  47. <p>The 3D objects center point.
  48. <code>( 0, 0 )</code> is the lower left, <code>( 1, 1 )</code> is the top right.</p>
  49. <p>Default is <code>(0.5,0.5)</code>.</p>
  50. </div>
  51. </div>
  52. <div class="member">
  53. <h3 class="name" id="element" translate="no">.<a href="#element">element</a><span class="type-signature"> : HTMLElement</span> <span class="type-signature">(readonly) </span></h3>
  54. <div class="description">
  55. <p>The DOM element which defines the appearance of this 3D object.</p>
  56. <p>Default is <code>true</code>.</p>
  57. </div>
  58. </div>
  59. <div class="member">
  60. <h3 class="name" id="isCSS2DObject" translate="no">.<a href="#isCSS2DObject">isCSS2DObject</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  61. <div class="description">
  62. <p>This flag can be used for type testing.</p>
  63. <p>Default is <code>true</code>.</p>
  64. </div>
  65. </div>
  66. <h2 class="subsection-title">Source</h2>
  67. <p>
  68. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/renderers/CSS2DRenderer.js" translate="no" target="_blank" rel="noopener">examples/jsm/renderers/CSS2DRenderer.js</a>
  69. </p>
  70. </article>
  71. </section>
  72. <script src="../scripts/linenumber.js"></script>
  73. <script src="../scripts/page.js"></script>
  74. </body>
  75. </html>
粤ICP备19079148号