CSS2DObject.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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">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"><code>element</code></td>
  33. <td class="description last"><p>The DOM element.</p></td>
  34. </tr>
  35. </tbody>
  36. </table>
  37. </div>
  38. </div>
  39. <h2 class="subsection-title">Properties</h2>
  40. <div class="member">
  41. <h3 class="name" id="center" translate="no">.<a href="#center">center</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
  42. <div class="description">
  43. <p>The 3D objects center point.
  44. <code>( 0, 0 )</code> is the lower left, <code>( 1, 1 )</code> is the top right.<br/>Default is <code>(0.5,0.5)</code>.</p>
  45. </div>
  46. </div>
  47. <div class="member">
  48. <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>
  49. <div class="description">
  50. <p>The DOM element which defines the appearance of this 3D object.<br/>Default is <code>true</code>.</p>
  51. </div>
  52. </div>
  53. <div class="member">
  54. <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>
  55. <div class="description">
  56. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  57. </div>
  58. </div>
  59. <h2 class="subsection-title">Source</h2>
  60. <p>
  61. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/renderers/CSS2DRenderer.js" target="_blank" rel="noopener" translate="no">examples/jsm/renderers/CSS2DRenderer.js</a>
  62. </p>
  63. </article>
  64. </section>
  65. <script src="../scripts/linenumber.js"></script>
  66. <script src="../scripts/page.js"></script>
  67. </body>
  68. </html>
粤ICP备19079148号