TextureUtils.html 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">A class containing utility functions for textures.</p>
  12. <h2>Methods</h2>
  13. <h3>[method:Texture contain]( [param:Texture texture], [param:Number aspect] )</h3>
  14. <p>
  15. Scales the texture as large as possible within its surface without cropping or stretching the texture. The method preserves the original aspect ratio of the texture. Akin to CSS `object-fit: contain`.
  16. </p>
  17. <h3>[method:Texture cover]( [param:Texture texture], [param:Number aspect] )</h3>
  18. <p>
  19. Scales the texture to the smallest possible size to fill the surface, leaving no empty space. The method preserves the original aspect ratio of the texture. Akin to CSS `object-fit: cover`.
  20. </p>
  21. <h3>[method:Texture fill]( [param:Texture texture] )</h3>
  22. <p>
  23. Configures the texture to the default transformation. Akin to CSS `object-fit: fill`.
  24. </p>
  25. <h3>[method:Number getByteLength]( [param:Number width], [param:Number height], [param:Number format], [param:Number type] )</h3>
  26. <p>
  27. Given the width, height, format, and type of a texture. Determines how
  28. many bytes must be used to represent the texture.
  29. </p>
  30. <h2>Source</h2>
  31. <p>
  32. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  33. </p>
  34. </body>
  35. </html>