SpriteSheetUVNode.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SpriteSheetUVNode - 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="Node.html">Node</a> → </p>
  13. <h1 translate="no">SpriteSheetUVNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Can be used to compute texture coordinates for animated sprite sheets.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const uvNode = spritesheetUV( vec2( 6, 6 ), uv(), time.mul( animationSpeed ) );
  19. material.colorNode = texture( spriteSheet, uvNode );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="SpriteSheetUVNode" translate="no">new <a href="#SpriteSheetUVNode">SpriteSheetUVNode</a><span class="signature">( countNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;vec2></span>, uvNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;vec2></span>, frameNode : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new sprite sheet uv node.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong>countNode</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The node that defines the number of sprites in the x and y direction (e.g 6x6).</p>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="name">
  42. <strong>uvNode</strong>
  43. </td>
  44. <td class="description last">
  45. <p>The uv node.</p>
  46. <p>Default is <code>uv()</code>.</p>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="name">
  51. <strong>frameNode</strong>
  52. </td>
  53. <td class="description last">
  54. <p>The node that defines the current frame/sprite.</p>
  55. <p>Default is <code>float()</code>.</p>
  56. </td>
  57. </tr>
  58. </tbody>
  59. </table>
  60. </div>
  61. </div>
  62. <h2 class="subsection-title">Properties</h2>
  63. <div class="member">
  64. <h3 class="name" id="countNode" translate="no">.<a href="#countNode">countNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec2></span> </h3>
  65. <div class="description">
  66. <p>The node that defines the number of sprites in the x and y direction (e.g 6x6).</p>
  67. </div>
  68. </div>
  69. <div class="member">
  70. <h3 class="name" id="frameNode" translate="no">.<a href="#frameNode">frameNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  71. <div class="description">
  72. <p>The node that defines the current frame/sprite.</p>
  73. </div>
  74. </div>
  75. <div class="member">
  76. <h3 class="name" id="uvNode" translate="no">.<a href="#uvNode">uvNode</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec2></span> </h3>
  77. <div class="description">
  78. <p>The uv node.</p>
  79. </div>
  80. </div>
  81. <h2 class="subsection-title">Source</h2>
  82. <p>
  83. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/utils/SpriteSheetUVNode.js" translate="no" target="_blank" rel="noopener">src/nodes/utils/SpriteSheetUVNode.js</a>
  84. </p>
  85. </article>
  86. </section>
  87. <script src="../scripts/linenumber.js"></script>
  88. <script src="../scripts/page.js"></script>
  89. </body>
  90. </html>
粤ICP备19079148号