| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>TGALoader - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="Loader.html">Loader</a> → <a href="DataTextureLoader.html">DataTextureLoader</a> → </p>
- <h1 translate="no">TGALoader</h1>
- <section>
- <header>
- <div class="class-description"><p>A loader for the TGA texture format.</p></div>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">const loader = new TGALoader();
- const texture = await loader.loadAsync( 'textures/crate_color8.tga' );
- texture.colorSpace = THREE.SRGBColorSpace; // only for color textures
- </code></pre></div>
- </header>
- <article>
- <h2 class="subsection-title">Import</h2>
- <p><span translate="no">TGALoader</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>
- <pre><code class="language-js">import { TGALoader } from 'three/addons/loaders/TGALoader.js';</code></pre>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="TGALoader" translate="no">new <a href="#TGALoader">TGALoader</a><span class="signature">( manager : <span class="param-type"><a href="LoadingManager.html">LoadingManager</a></span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new TGA loader.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>manager</strong>
- </td>
- <td class="description last">
- <p>The loading manager.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( buffer : <span class="param-type">ArrayBuffer</span> )</span><span class="type-signature"> : <a href="DataTextureLoader.html#~TexData">DataTextureLoader~TexData</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Parses the given TGA texture data.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>buffer</strong>
- </td>
- <td class="description last">
- <p>The raw texture data.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="DataTextureLoader.html#parse">DataTextureLoader#parse</a></dt>
- </dl>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> An object representing the parsed texture data.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/TGALoader.js" translate="no" target="_blank" rel="noopener">examples/jsm/loaders/TGALoader.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|