Skip to content

Commit

Permalink
[Doc/zh] add TextureUtils.html (#29314)
Browse files Browse the repository at this point in the history
  • Loading branch information
puxiao authored Sep 4, 2024
1 parent 4818710 commit 151a1f2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
42 changes: 42 additions & 0 deletions docs/api/zh/extras/TextureUtils.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>

<p class="desc">包含纹理实用函数的类。</p>

<h2>方法</h2>

<h3>[method:Texture contain]( [param:Texture texture], [param:Number aspect] )</h3>
<p>
在不裁剪或拉伸纹理的情况下,将纹理在其表面内缩放到尽可能大。该方法保留了纹理的原始纵横比。类似于 CSS 中的 `object-fit: contain`。
</p>

<h3>[method:Texture cover]( [param:Texture texture], [param:Number aspect] )</h3>
<p>
将纹理缩放到尽可能小的尺寸以填充表面,不留空白。该方法保留了纹理的原始纵横比。类似于 CSS 中的 `object-fit: cover`。
</p>

<h3>[method:Texture fill]( [param:Texture texture] )</h3>
<p>
将纹理配置为默认转换。类似于 CSS 中的 `object-fit: fill`。
</p>

<h3>[method:Number getByteLength]( [param:Number width], [param:Number height], [param:Number format], [param:Number type] )</h3>
<p>
给定纹理的宽度、高度、格式和类型。确定必须使用多少个字节来表示纹理。
</p>

<h2>源代码</h2>

<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>
3 changes: 2 additions & 1 deletion docs/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@
"Earcut": "api/zh/extras/Earcut",
"ImageUtils": "api/zh/extras/ImageUtils",
"PMREMGenerator": "api/zh/extras/PMREMGenerator",
"ShapeUtils": "api/zh/extras/ShapeUtils"
"ShapeUtils": "api/zh/extras/ShapeUtils",
"TextureUtils": "api/zh/extras/TextureUtils"
},

"附件 / 核心": {
Expand Down

0 comments on commit 151a1f2

Please sign in to comment.