Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

docs: illustrate texture wrap modes in the Sprites guide (en + zh)

yhhd4547b08dd85
diff --git a/docs/astro/src/assets/guides/texture-wrap.png b/docs/astro/src/assets/guides/texture-wrap.png
new file mode 100644
index 000000000..8ec3db4a1
Binary files /dev/null and b/docs/astro/src/assets/guides/texture-wrap.png differ
diff --git a/docs/astro/src/content/docs/guides/sprites.mdx b/docs/astro/src/content/docs/guides/sprites.mdx
index b56fc28fc..7783c75f8 100644
--- a/docs/astro/src/content/docs/guides/sprites.mdx
+++ b/docs/astro/src/content/docs/guides/sprites.mdx
@@ -159,6 +159,12 @@ setTextureParams(tex.handle, TextureFilter.Nearest, TextureFilter.Nearest,
surface — separate minification/magnification filters and per-axis wrap. `Repeat`
is what makes `tileSize` tiling and UV-scroll effects seamless.
+![How each wrap mode samples UVs outside 0–1: Repeat tiles the texture, Clamp to edge extends the border pixel, Mirror flips every other tile](../../../assets/guides/texture-wrap.png)
+
+*What each wrap mode does with UVs outside the 0–1 range (centre tile = the
+texture): **Repeat** tiles it, **Clamp to edge** stretches the border pixel, and
+**Mirror** flips every other copy.*
+
<Aside type="tip">
For pixel art, `TextureFilter.Nearest` is half the story: it keeps **texels**
crisp, but a camera at a fractional position still lands sprites between screen
diff --git a/docs/astro/src/content/docs/zh-cn/guides/sprites.mdx b/docs/astro/src/content/docs/zh-cn/guides/sprites.mdx
index 9fd05eb1c..4da3f610a 100644
--- a/docs/astro/src/content/docs/zh-cn/guides/sprites.mdx
+++ b/docs/astro/src/content/docs/zh-cn/guides/sprites.mdx
@@ -143,6 +143,11 @@ setTextureParams(tex.handle, TextureFilter.Nearest, TextureFilter.Nearest,
缩小/放大过滤分开,环绕逐轴设置。`tileSize` 平铺和 UV 滚动效果要无缝,靠的就是
`Repeat`。
+![各环绕模式对 0–1 之外 UV 的采样:Repeat 平铺纹理,Clamp to edge 拉伸边缘像素,Mirror 每隔一块翻转](../../../../assets/guides/texture-wrap.png)
+
+*各环绕模式如何处理 0–1 之外的 UV(中间那块 = 纹理本身):**Repeat** 平铺,**Clamp to edge**
+拉伸边缘像素,**Mirror** 每隔一块镜像翻转。*
+
<Aside type="tip">
对像素画来说 `TextureFilter.Nearest` 只解决一半问题:它让**纹素**锐利,但相机
停在小数位置时精灵仍会落在屏幕像素之间,移动时闪烁。把它和相机的