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.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
docs: illustrate texture filtering and camera follow (en + zh)
yhhd7fe857ffa75
diff --git a/docs/astro/src/assets/guides/camera-follow.svg b/docs/astro/src/assets/guides/camera-follow.svgnew file mode 100644index 000000000..f63127f2d--- /dev/null+++ b/docs/astro/src/assets/guides/camera-follow.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 460 248" width="460" height="248" role="img"><defs><marker id="a2" markerWidth="7" markerHeight="7" refX="5.5" refY="3.5" orient="auto"><path d="M0 0 L7 3.5 L0 7 z" fill="#8b91a0"/></marker></defs><rect x="44" y="34" width="372" height="176" rx="6" fill="#14161c" stroke="#c7cdd8" stroke-width="1.6"/><text x="408" y="50" fill="#6b7280" font-size="10" font-weight="600" text-anchor="end" font-family="ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif">camera view</text><line x1="222" y1="116" x2="242" y2="116" stroke="#8b91a0" stroke-width="1.3"/><line x1="232" y1="106" x2="232" y2="126" stroke="#8b91a0" stroke-width="1.3"/><text x="248" y="110" fill="#8b91a0" font-size="10" font-weight="600" text-anchor="start" font-family="ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif">view centre</text><circle cx="232" cy="170" r="38" fill="#22c55e" fill-opacity="0.08" stroke="#8b91a0" stroke-width="1.2" stroke-dasharray="4 3"/><text x="278" y="200" fill="#8b91a0" font-size="10" font-weight="600" text-anchor="start" font-family="ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif">deadzone</text><line x1="276" y1="197" x2="259" y2="190" stroke="#8b91a0" stroke-width="1"/><circle cx="232" cy="170" r="13" fill="#4aa3ff" stroke="#0d0e11" stroke-width="1.5"/><text x="232" y="174" fill="#ffffff" font-size="12" font-weight="600" text-anchor="middle" font-family="ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif">T</text><line x1="168" y1="116" x2="226" y2="116" stroke="#3a3f4b" stroke-width="1" stroke-dasharray="3 3"/><line x1="168" y1="170" x2="188" y2="170" stroke="#3a3f4b" stroke-width="1" stroke-dasharray="3 3"/><line x1="168" y1="118" x2="168" y2="168" stroke="#8b91a0" stroke-width="1.3" marker-start="url(#a2)" marker-end="url(#a2)"/><text x="160" y="147" fill="#8b91a0" font-size="11" font-weight="600" text-anchor="end" font-family="ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif">offset</text><circle cx="306" cy="150" r="11" fill="#4aa3ff" fill-opacity="0.25" stroke="#4aa3ff" stroke-opacity="0.5" stroke-width="1.3"/><path d="M 296 148 Q 272 130 244 164" fill="none" stroke="#8b91a0" stroke-width="1.3" stroke-dasharray="4 3" marker-end="url(#a2)"/><text x="318" y="148" fill="#5f95d6" font-size="10" font-weight="600" text-anchor="start" font-family="ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif">leaves →</text><text x="230" y="236" fill="#8b91a0" font-size="11" font-weight="600" text-anchor="middle" font-family="ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif">holds the offset · roams free inside the deadzone · eases after it (damping)</text></svg>\ No newline at end of filediff --git a/docs/astro/src/assets/guides/texture-filter.png b/docs/astro/src/assets/guides/texture-filter.pngnew file mode 100644index 000000000..90ca1422cBinary files /dev/null and b/docs/astro/src/assets/guides/texture-filter.png differdiff --git a/docs/astro/src/content/docs/guides/camera.mdx b/docs/astro/src/content/docs/guides/camera.mdxindex dc903b804..989cfa6f2 100644--- a/docs/astro/src/content/docs/guides/camera.mdx+++ b/docs/astro/src/content/docs/guides/camera.mdx@@ -110,6 +110,8 @@ Add a `FollowTarget` to the camera and point it at an entity. The follow is aframe-rate-independent damped move with a dead zone, so the camera drifts smoothlyand ignores tiny movements:++```typescriptimport { defineSystem, Query, Commands, Camera, FollowTarget } from 'esengine';diff --git a/docs/astro/src/content/docs/guides/sprites.mdx b/docs/astro/src/content/docs/guides/sprites.mdxindex ec168badb..b56fc28fc 100644--- a/docs/astro/src/content/docs/guides/sprites.mdx+++ b/docs/astro/src/content/docs/guides/sprites.mdx@@ -133,6 +133,11 @@ front of it — no manual `layer` or z juggling.How a texture is sampled is set **per texture handle**, not per sprite:+++*The same tiny texture magnified ~15×. **Nearest** keeps texel edges hard (pixel+art); **Linear** interpolates between texels for a smooth look (the default).*+| Enum | Values | Meaning ||---|---|---|| `TextureFilter` | `Nearest`, `Linear` | Nearest = hard texel edges (pixel art); Linear = smooth interpolation (default). |diff --git a/docs/astro/src/content/docs/zh-cn/guides/camera.mdx b/docs/astro/src/content/docs/zh-cn/guides/camera.mdxindex 469a4dd2a..90eeb6585 100644--- a/docs/astro/src/content/docs/zh-cn/guides/camera.mdx+++ b/docs/astro/src/content/docs/zh-cn/guides/camera.mdx@@ -100,6 +100,8 @@ const zoomIn = defineSystem([Res(Tween)], (tween) => {给相机加一个 `FollowTarget` 并指向一个实体。跟随是帧率无关的阻尼移动,带一个死区,所以相机平滑漂移并忽略细小移动:++```typescriptimport { defineSystem, Query, Commands, Camera, FollowTarget } from 'esengine';diff --git a/docs/astro/src/content/docs/zh-cn/guides/sprites.mdx b/docs/astro/src/content/docs/zh-cn/guides/sprites.mdxindex d7f571734..9fd05eb1c 100644--- a/docs/astro/src/content/docs/zh-cn/guides/sprites.mdx+++ b/docs/astro/src/content/docs/zh-cn/guides/sprites.mdx@@ -117,6 +117,11 @@ sprite.layer = 2; // 例如 "Foreground" —— 画在上面纹理的采样方式按**纹理句柄**设置,而非按精灵:+++*同一张小纹理放大约 15×。**Nearest(最近邻)** 保留硬的纹素边缘(像素画);**Linear(线性)**+在纹素间插值,得到平滑外观(默认)。*+| 枚举 | 取值 | 含义 ||---|---|---|| `TextureFilter` | `Nearest`、`Linear` | Nearest = 纹素边缘生硬(像素画);Linear = 平滑插值(默认)。 |