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: retake every guide picture, add the Cocos import page, RectAnchors, UIPages, the Runtime settings and the other pages the notes left out, and fix a front matter, a component summary and a link that kept the site from building

yhh011614fa46a9
diff --git a/docs/astro/astro.config.mjs b/docs/astro/astro.config.mjs
index 1411a6fd2..8fdde02fa 100644
--- a/docs/astro/astro.config.mjs
+++ b/docs/astro/astro.config.mjs
@@ -170,6 +170,7 @@ export default defineConfig({
{ label: 'Play in the Editor', translations: { 'zh-CN': '编辑器内运行' }, slug: 'editor/play' },
{ label: 'Asset Editors', translations: { 'zh-CN': '专用编辑器' }, slug: 'editor/asset-editors' },
{ label: 'Project Settings', translations: { 'zh-CN': '项目设置' }, slug: 'editor/settings' },
+ { label: 'Importing a Cocos Project', translations: { 'zh-CN': '导入 Cocos 项目' }, slug: 'editor/cocos-import' },
{ label: 'History, Scatter & Health', translations: { 'zh-CN': '历史、散布与健康' }, slug: 'editor/history-scatter-health' },
{ label: 'Keyboard Shortcuts', translations: { 'zh-CN': '键盘快捷键' }, slug: 'editor/shortcuts' },
],
diff --git a/docs/astro/src/assets/guides/en/agent-preview.png b/docs/astro/src/assets/guides/en/agent-preview.png
index 197e7a9a5..2ffca6f53 100644
Binary files a/docs/astro/src/assets/guides/en/agent-preview.png and b/docs/astro/src/assets/guides/en/agent-preview.png differ
diff --git a/docs/astro/src/assets/guides/en/agent-settings.png b/docs/astro/src/assets/guides/en/agent-settings.png
index d9d9919af..13e33bfff 100644
Binary files a/docs/astro/src/assets/guides/en/agent-settings.png and b/docs/astro/src/assets/guides/en/agent-settings.png differ
diff --git a/docs/astro/src/assets/guides/en/agent-turn.png b/docs/astro/src/assets/guides/en/agent-turn.png
index 496bf3aa1..d39666fa7 100644
Binary files a/docs/astro/src/assets/guides/en/agent-turn.png and b/docs/astro/src/assets/guides/en/agent-turn.png differ
diff --git a/docs/astro/src/assets/guides/en/ai-bt.png b/docs/astro/src/assets/guides/en/ai-bt.png
index a9e174d60..8666e9fa0 100644
Binary files a/docs/astro/src/assets/guides/en/ai-bt.png and b/docs/astro/src/assets/guides/en/ai-bt.png differ
diff --git a/docs/astro/src/assets/guides/en/ai-fsm.png b/docs/astro/src/assets/guides/en/ai-fsm.png
index a411e4f51..d2420279c 100644
Binary files a/docs/astro/src/assets/guides/en/ai-fsm.png and b/docs/astro/src/assets/guides/en/ai-fsm.png differ
diff --git a/docs/astro/src/assets/guides/en/animator-graph.png b/docs/astro/src/assets/guides/en/animator-graph.png
index 73498a56c..b6eeb4f1d 100644
Binary files a/docs/astro/src/assets/guides/en/animator-graph.png and b/docs/astro/src/assets/guides/en/animator-graph.png differ
diff --git a/docs/astro/src/assets/guides/en/build-dialog.png b/docs/astro/src/assets/guides/en/build-dialog.png
index da79d8e9f..c696f4268 100644
Binary files a/docs/astro/src/assets/guides/en/build-dialog.png and b/docs/astro/src/assets/guides/en/build-dialog.png differ
diff --git a/docs/astro/src/assets/guides/en/collision-matrix.png b/docs/astro/src/assets/guides/en/collision-matrix.png
index 17b8ada31..6537f36fd 100644
Binary files a/docs/astro/src/assets/guides/en/collision-matrix.png and b/docs/astro/src/assets/guides/en/collision-matrix.png differ
diff --git a/docs/astro/src/assets/guides/en/collision-palette.png b/docs/astro/src/assets/guides/en/collision-palette.png
index 7b7f1bf10..de3acd370 100644
Binary files a/docs/astro/src/assets/guides/en/collision-palette.png and b/docs/astro/src/assets/guides/en/collision-palette.png differ
diff --git a/docs/astro/src/assets/guides/en/controllers-strip.png b/docs/astro/src/assets/guides/en/controllers-strip.png
index ee4c22fae..355df88a5 100644
Binary files a/docs/astro/src/assets/guides/en/controllers-strip.png and b/docs/astro/src/assets/guides/en/controllers-strip.png differ
diff --git a/docs/astro/src/assets/guides/en/dragonbones-inspector.png b/docs/astro/src/assets/guides/en/dragonbones-inspector.png
index 518385a20..e1d0c3fd0 100644
Binary files a/docs/astro/src/assets/guides/en/dragonbones-inspector.png and b/docs/astro/src/assets/guides/en/dragonbones-inspector.png differ
diff --git a/docs/astro/src/assets/guides/en/dragonbones-shared.png b/docs/astro/src/assets/guides/en/dragonbones-shared.png
index 1039f2da4..00bca2e26 100644
Binary files a/docs/astro/src/assets/guides/en/dragonbones-shared.png and b/docs/astro/src/assets/guides/en/dragonbones-shared.png differ
diff --git a/docs/astro/src/assets/guides/en/editor-overview.png b/docs/astro/src/assets/guides/en/editor-overview.png
index 7611bfe9e..a86d3df70 100644
Binary files a/docs/astro/src/assets/guides/en/editor-overview.png and b/docs/astro/src/assets/guides/en/editor-overview.png differ
diff --git a/docs/astro/src/assets/guides/en/events-fsm.png b/docs/astro/src/assets/guides/en/events-fsm.png
index e1cbc1666..035c21347 100644
Binary files a/docs/astro/src/assets/guides/en/events-fsm.png and b/docs/astro/src/assets/guides/en/events-fsm.png differ
diff --git a/docs/astro/src/assets/guides/en/events-palette.png b/docs/astro/src/assets/guides/en/events-palette.png
index 0ff51ab6a..85f7895f3 100644
Binary files a/docs/astro/src/assets/guides/en/events-palette.png and b/docs/astro/src/assets/guides/en/events-palette.png differ
diff --git a/docs/astro/src/assets/guides/en/events-section.png b/docs/astro/src/assets/guides/en/events-section.png
index eaf4e3785..fd1e7ddeb 100644
Binary files a/docs/astro/src/assets/guides/en/events-section.png and b/docs/astro/src/assets/guides/en/events-section.png differ
diff --git a/docs/astro/src/assets/guides/en/flipbook.png b/docs/astro/src/assets/guides/en/flipbook.png
index 389a523a5..d51128f3c 100644
Binary files a/docs/astro/src/assets/guides/en/flipbook.png and b/docs/astro/src/assets/guides/en/flipbook.png differ
diff --git a/docs/astro/src/assets/guides/en/game-target-screen.png b/docs/astro/src/assets/guides/en/game-target-screen.png
index ecbc08fa4..7e5d6e5bc 100644
Binary files a/docs/astro/src/assets/guides/en/game-target-screen.png and b/docs/astro/src/assets/guides/en/game-target-screen.png differ
diff --git a/docs/astro/src/assets/guides/en/hot-update-build-cdn.png b/docs/astro/src/assets/guides/en/hot-update-build-cdn.png
index 11fb2953e..0ca88e029 100644
Binary files a/docs/astro/src/assets/guides/en/hot-update-build-cdn.png and b/docs/astro/src/assets/guides/en/hot-update-build-cdn.png differ
diff --git a/docs/astro/src/assets/guides/en/hot-update-cdn-badge.png b/docs/astro/src/assets/guides/en/hot-update-cdn-badge.png
index d1ba7f181..ff5c3bcd8 100644
Binary files a/docs/astro/src/assets/guides/en/hot-update-cdn-badge.png and b/docs/astro/src/assets/guides/en/hot-update-cdn-badge.png differ
diff --git a/docs/astro/src/assets/guides/en/hot-update-delivery-menu.png b/docs/astro/src/assets/guides/en/hot-update-delivery-menu.png
index 7bfdba8d9..cde55d12f 100644
Binary files a/docs/astro/src/assets/guides/en/hot-update-delivery-menu.png and b/docs/astro/src/assets/guides/en/hot-update-delivery-menu.png differ
diff --git a/docs/astro/src/assets/guides/en/import-platform-overrides.png b/docs/astro/src/assets/guides/en/import-platform-overrides.png
index 83a8ea5c9..ef67e4c3d 100644
Binary files a/docs/astro/src/assets/guides/en/import-platform-overrides.png and b/docs/astro/src/assets/guides/en/import-platform-overrides.png differ
diff --git a/docs/astro/src/assets/guides/en/input-map.png b/docs/astro/src/assets/guides/en/input-map.png
index 60d780533..a212bfd6d 100644
Binary files a/docs/astro/src/assets/guides/en/input-map.png and b/docs/astro/src/assets/guides/en/input-map.png differ
diff --git a/docs/astro/src/assets/guides/en/inspector-flex.png b/docs/astro/src/assets/guides/en/inspector-flex.png
index 55a41954e..55a4c62de 100644
Binary files a/docs/astro/src/assets/guides/en/inspector-flex.png and b/docs/astro/src/assets/guides/en/inspector-flex.png differ
diff --git a/docs/astro/src/assets/guides/en/lighting.png b/docs/astro/src/assets/guides/en/lighting.png
index dedd9f49b..e40ae90bb 100644
Binary files a/docs/astro/src/assets/guides/en/lighting.png and b/docs/astro/src/assets/guides/en/lighting.png differ
diff --git a/docs/astro/src/assets/guides/en/localization.png b/docs/astro/src/assets/guides/en/localization.png
index 9bc3092fe..991eefec0 100644
Binary files a/docs/astro/src/assets/guides/en/localization.png and b/docs/astro/src/assets/guides/en/localization.png differ
diff --git a/docs/astro/src/assets/guides/en/marker-inspector.png b/docs/astro/src/assets/guides/en/marker-inspector.png
index 3c7683c07..d47b0b1f6 100644
Binary files a/docs/astro/src/assets/guides/en/marker-inspector.png and b/docs/astro/src/assets/guides/en/marker-inspector.png differ
diff --git a/docs/astro/src/assets/guides/en/material-shader.png b/docs/astro/src/assets/guides/en/material-shader.png
index ede635d34..84dfbef2e 100644
Binary files a/docs/astro/src/assets/guides/en/material-shader.png and b/docs/astro/src/assets/guides/en/material-shader.png differ
diff --git a/docs/astro/src/assets/guides/en/nine-slice-drag.png b/docs/astro/src/assets/guides/en/nine-slice-drag.png
index 83a8ea5c9..ef67e4c3d 100644
Binary files a/docs/astro/src/assets/guides/en/nine-slice-drag.png and b/docs/astro/src/assets/guides/en/nine-slice-drag.png differ
diff --git a/docs/astro/src/assets/guides/en/orient-hex.png b/docs/astro/src/assets/guides/en/orient-hex.png
index c0831a21f..9bb2f28a6 100644
Binary files a/docs/astro/src/assets/guides/en/orient-hex.png and b/docs/astro/src/assets/guides/en/orient-hex.png differ
diff --git a/docs/astro/src/assets/guides/en/orient-staggered.png b/docs/astro/src/assets/guides/en/orient-staggered.png
index 4824db30e..9c467ebab 100644
Binary files a/docs/astro/src/assets/guides/en/orient-staggered.png and b/docs/astro/src/assets/guides/en/orient-staggered.png differ
diff --git a/docs/astro/src/assets/guides/en/outliner-prefab-menu.png b/docs/astro/src/assets/guides/en/outliner-prefab-menu.png
new file mode 100644
index 000000000..b06a7ec97
Binary files /dev/null and b/docs/astro/src/assets/guides/en/outliner-prefab-menu.png differ
diff --git a/docs/astro/src/assets/guides/en/particle-view.png b/docs/astro/src/assets/guides/en/particle-view.png
index 77e20c1b2..6e732a3b3 100644
Binary files a/docs/astro/src/assets/guides/en/particle-view.png and b/docs/astro/src/assets/guides/en/particle-view.png differ
diff --git a/docs/astro/src/assets/guides/en/physics-collider.png b/docs/astro/src/assets/guides/en/physics-collider.png
index 964e1a9fe..243085124 100644
Binary files a/docs/astro/src/assets/guides/en/physics-collider.png and b/docs/astro/src/assets/guides/en/physics-collider.png differ
diff --git a/docs/astro/src/assets/guides/en/prefab-mode.png b/docs/astro/src/assets/guides/en/prefab-mode.png
index b954bcba9..e924479ed 100644
Binary files a/docs/astro/src/assets/guides/en/prefab-mode.png and b/docs/astro/src/assets/guides/en/prefab-mode.png differ
diff --git a/docs/astro/src/assets/guides/en/prefab-virtual-toggle.png b/docs/astro/src/assets/guides/en/prefab-virtual-toggle.png
new file mode 100644
index 000000000..5dca773d2
Binary files /dev/null and b/docs/astro/src/assets/guides/en/prefab-virtual-toggle.png differ
diff --git a/docs/astro/src/assets/guides/en/seq-curves.png b/docs/astro/src/assets/guides/en/seq-curves.png
index 15bc7e148..d07f85895 100644
Binary files a/docs/astro/src/assets/guides/en/seq-curves.png and b/docs/astro/src/assets/guides/en/seq-curves.png differ
diff --git a/docs/astro/src/assets/guides/en/seq-dopesheet.png b/docs/astro/src/assets/guides/en/seq-dopesheet.png
index 92124d448..cad62863a 100644
Binary files a/docs/astro/src/assets/guides/en/seq-dopesheet.png and b/docs/astro/src/assets/guides/en/seq-dopesheet.png differ
diff --git a/docs/astro/src/assets/guides/en/settings-runtime.png b/docs/astro/src/assets/guides/en/settings-runtime.png
new file mode 100644
index 000000000..19f694ab4
Binary files /dev/null and b/docs/astro/src/assets/guides/en/settings-runtime.png differ
diff --git a/docs/astro/src/assets/guides/en/settings-screen-presets.png b/docs/astro/src/assets/guides/en/settings-screen-presets.png
index 15ca29325..5fd2dcf10 100644
Binary files a/docs/astro/src/assets/guides/en/settings-screen-presets.png and b/docs/astro/src/assets/guides/en/settings-screen-presets.png differ
diff --git a/docs/astro/src/assets/guides/en/settings-shader-compilation.png b/docs/astro/src/assets/guides/en/settings-shader-compilation.png
new file mode 100644
index 000000000..97db6b026
Binary files /dev/null and b/docs/astro/src/assets/guides/en/settings-shader-compilation.png differ
diff --git a/docs/astro/src/assets/guides/en/steam-channel.png b/docs/astro/src/assets/guides/en/steam-channel.png
index 236abcd62..783ea5de4 100644
Binary files a/docs/astro/src/assets/guides/en/steam-channel.png and b/docs/astro/src/assets/guides/en/steam-channel.png differ
diff --git a/docs/astro/src/assets/guides/en/tilemap-new.png b/docs/astro/src/assets/guides/en/tilemap-new.png
index 4bf369dc1..a9e40e5da 100644
Binary files a/docs/astro/src/assets/guides/en/tilemap-new.png and b/docs/astro/src/assets/guides/en/tilemap-new.png differ
diff --git a/docs/astro/src/assets/guides/en/tilemap-overview.png b/docs/astro/src/assets/guides/en/tilemap-overview.png
index 18d749bc3..bc9dbee39 100644
Binary files a/docs/astro/src/assets/guides/en/tilemap-overview.png and b/docs/astro/src/assets/guides/en/tilemap-overview.png differ
diff --git a/docs/astro/src/assets/guides/en/tilemap-tools.png b/docs/astro/src/assets/guides/en/tilemap-tools.png
index 6055a4cac..38e774ba2 100644
Binary files a/docs/astro/src/assets/guides/en/tilemap-tools.png and b/docs/astro/src/assets/guides/en/tilemap-tools.png differ
diff --git a/docs/astro/src/assets/guides/en/tileset-animation.png b/docs/astro/src/assets/guides/en/tileset-animation.png
index 5660255db..c9fe70c2e 100644
Binary files a/docs/astro/src/assets/guides/en/tileset-animation.png and b/docs/astro/src/assets/guides/en/tileset-animation.png differ
diff --git a/docs/astro/src/assets/guides/en/tileset-collision.png b/docs/astro/src/assets/guides/en/tileset-collision.png
index 6d09adb16..90a931eae 100644
Binary files a/docs/astro/src/assets/guides/en/tileset-collision.png and b/docs/astro/src/assets/guides/en/tileset-collision.png differ
diff --git a/docs/astro/src/assets/guides/en/tileset-terrain.png b/docs/astro/src/assets/guides/en/tileset-terrain.png
index 61a81e92a..ae384f645 100644
Binary files a/docs/astro/src/assets/guides/en/tileset-terrain.png and b/docs/astro/src/assets/guides/en/tileset-terrain.png differ
diff --git a/docs/astro/src/assets/guides/en/ui-screen.png b/docs/astro/src/assets/guides/en/ui-screen.png
index 88036d533..4ba89190b 100644
Binary files a/docs/astro/src/assets/guides/en/ui-screen.png and b/docs/astro/src/assets/guides/en/ui-screen.png differ
diff --git a/docs/astro/src/assets/guides/en/widgets-gallery.png b/docs/astro/src/assets/guides/en/widgets-gallery.png
index 4ac396334..0f38d5502 100644
Binary files a/docs/astro/src/assets/guides/en/widgets-gallery.png and b/docs/astro/src/assets/guides/en/widgets-gallery.png differ
diff --git a/docs/astro/src/assets/guides/zh/agent-preview.png b/docs/astro/src/assets/guides/zh/agent-preview.png
index 866a769cf..5452f2e2a 100644
Binary files a/docs/astro/src/assets/guides/zh/agent-preview.png and b/docs/astro/src/assets/guides/zh/agent-preview.png differ
diff --git a/docs/astro/src/assets/guides/zh/agent-settings.png b/docs/astro/src/assets/guides/zh/agent-settings.png
index 39541251e..1b108dc5b 100644
Binary files a/docs/astro/src/assets/guides/zh/agent-settings.png and b/docs/astro/src/assets/guides/zh/agent-settings.png differ
diff --git a/docs/astro/src/assets/guides/zh/agent-turn.png b/docs/astro/src/assets/guides/zh/agent-turn.png
index c46dbf3fd..ff6c2c597 100644
Binary files a/docs/astro/src/assets/guides/zh/agent-turn.png and b/docs/astro/src/assets/guides/zh/agent-turn.png differ
diff --git a/docs/astro/src/assets/guides/zh/ai-bt.png b/docs/astro/src/assets/guides/zh/ai-bt.png
index 48b30833e..14db29f28 100644
Binary files a/docs/astro/src/assets/guides/zh/ai-bt.png and b/docs/astro/src/assets/guides/zh/ai-bt.png differ
diff --git a/docs/astro/src/assets/guides/zh/ai-fsm.png b/docs/astro/src/assets/guides/zh/ai-fsm.png
index e33eb0452..6fcd5d466 100644
Binary files a/docs/astro/src/assets/guides/zh/ai-fsm.png and b/docs/astro/src/assets/guides/zh/ai-fsm.png differ
diff --git a/docs/astro/src/assets/guides/zh/animator-graph.png b/docs/astro/src/assets/guides/zh/animator-graph.png
index 4729d8b77..6b8ba91e3 100644
Binary files a/docs/astro/src/assets/guides/zh/animator-graph.png and b/docs/astro/src/assets/guides/zh/animator-graph.png differ
diff --git a/docs/astro/src/assets/guides/zh/build-dialog.png b/docs/astro/src/assets/guides/zh/build-dialog.png
index 60dbf11df..c31ec4603 100644
Binary files a/docs/astro/src/assets/guides/zh/build-dialog.png and b/docs/astro/src/assets/guides/zh/build-dialog.png differ
diff --git a/docs/astro/src/assets/guides/zh/collision-matrix.png b/docs/astro/src/assets/guides/zh/collision-matrix.png
index 18fcca263..4543e1858 100644
Binary files a/docs/astro/src/assets/guides/zh/collision-matrix.png and b/docs/astro/src/assets/guides/zh/collision-matrix.png differ
diff --git a/docs/astro/src/assets/guides/zh/collision-palette.png b/docs/astro/src/assets/guides/zh/collision-palette.png
index cec83010d..19fc70841 100644
Binary files a/docs/astro/src/assets/guides/zh/collision-palette.png and b/docs/astro/src/assets/guides/zh/collision-palette.png differ
diff --git a/docs/astro/src/assets/guides/zh/controllers-strip.png b/docs/astro/src/assets/guides/zh/controllers-strip.png
index 804b94a67..68c2fc824 100644
Binary files a/docs/astro/src/assets/guides/zh/controllers-strip.png and b/docs/astro/src/assets/guides/zh/controllers-strip.png differ
diff --git a/docs/astro/src/assets/guides/zh/dragonbones-inspector.png b/docs/astro/src/assets/guides/zh/dragonbones-inspector.png
index 2c82a8016..716ea5851 100644
Binary files a/docs/astro/src/assets/guides/zh/dragonbones-inspector.png and b/docs/astro/src/assets/guides/zh/dragonbones-inspector.png differ
diff --git a/docs/astro/src/assets/guides/zh/dragonbones-shared.png b/docs/astro/src/assets/guides/zh/dragonbones-shared.png
index 5cf8a3eae..f5870fd8e 100644
Binary files a/docs/astro/src/assets/guides/zh/dragonbones-shared.png and b/docs/astro/src/assets/guides/zh/dragonbones-shared.png differ
diff --git a/docs/astro/src/assets/guides/zh/editor-overview.png b/docs/astro/src/assets/guides/zh/editor-overview.png
index 81cc364df..0d1b31cb1 100644
Binary files a/docs/astro/src/assets/guides/zh/editor-overview.png and b/docs/astro/src/assets/guides/zh/editor-overview.png differ
diff --git a/docs/astro/src/assets/guides/zh/events-fsm.png b/docs/astro/src/assets/guides/zh/events-fsm.png
index 35eb98dd7..a2f790748 100644
Binary files a/docs/astro/src/assets/guides/zh/events-fsm.png and b/docs/astro/src/assets/guides/zh/events-fsm.png differ
diff --git a/docs/astro/src/assets/guides/zh/events-palette.png b/docs/astro/src/assets/guides/zh/events-palette.png
index c83d27fe7..2e6421086 100644
Binary files a/docs/astro/src/assets/guides/zh/events-palette.png and b/docs/astro/src/assets/guides/zh/events-palette.png differ
diff --git a/docs/astro/src/assets/guides/zh/events-section.png b/docs/astro/src/assets/guides/zh/events-section.png
index 43fbb1a3d..09a7c77cb 100644
Binary files a/docs/astro/src/assets/guides/zh/events-section.png and b/docs/astro/src/assets/guides/zh/events-section.png differ
diff --git a/docs/astro/src/assets/guides/zh/flipbook.png b/docs/astro/src/assets/guides/zh/flipbook.png
index 9eb01ee5d..3850d5022 100644
Binary files a/docs/astro/src/assets/guides/zh/flipbook.png and b/docs/astro/src/assets/guides/zh/flipbook.png differ
diff --git a/docs/astro/src/assets/guides/zh/game-target-screen.png b/docs/astro/src/assets/guides/zh/game-target-screen.png
index 9388b42a7..f88d438ba 100644
Binary files a/docs/astro/src/assets/guides/zh/game-target-screen.png and b/docs/astro/src/assets/guides/zh/game-target-screen.png differ
diff --git a/docs/astro/src/assets/guides/zh/hot-update-build-cdn.png b/docs/astro/src/assets/guides/zh/hot-update-build-cdn.png
index 0fc9c0b6d..f1972fb0d 100644
Binary files a/docs/astro/src/assets/guides/zh/hot-update-build-cdn.png and b/docs/astro/src/assets/guides/zh/hot-update-build-cdn.png differ
diff --git a/docs/astro/src/assets/guides/zh/hot-update-cdn-badge.png b/docs/astro/src/assets/guides/zh/hot-update-cdn-badge.png
index d1ba7f181..ff5c3bcd8 100644
Binary files a/docs/astro/src/assets/guides/zh/hot-update-cdn-badge.png and b/docs/astro/src/assets/guides/zh/hot-update-cdn-badge.png differ
diff --git a/docs/astro/src/assets/guides/zh/hot-update-delivery-menu.png b/docs/astro/src/assets/guides/zh/hot-update-delivery-menu.png
index 1e5c63ebc..f116b9b78 100644
Binary files a/docs/astro/src/assets/guides/zh/hot-update-delivery-menu.png and b/docs/astro/src/assets/guides/zh/hot-update-delivery-menu.png differ
diff --git a/docs/astro/src/assets/guides/zh/import-platform-overrides.png b/docs/astro/src/assets/guides/zh/import-platform-overrides.png
index a92f0dc52..784704e27 100644
Binary files a/docs/astro/src/assets/guides/zh/import-platform-overrides.png and b/docs/astro/src/assets/guides/zh/import-platform-overrides.png differ
diff --git a/docs/astro/src/assets/guides/zh/input-map.png b/docs/astro/src/assets/guides/zh/input-map.png
index c7a741f05..37820420b 100644
Binary files a/docs/astro/src/assets/guides/zh/input-map.png and b/docs/astro/src/assets/guides/zh/input-map.png differ
diff --git a/docs/astro/src/assets/guides/zh/inspector-flex.png b/docs/astro/src/assets/guides/zh/inspector-flex.png
index b8d1473e6..d8a1b4256 100644
Binary files a/docs/astro/src/assets/guides/zh/inspector-flex.png and b/docs/astro/src/assets/guides/zh/inspector-flex.png differ
diff --git a/docs/astro/src/assets/guides/zh/lighting.png b/docs/astro/src/assets/guides/zh/lighting.png
index 4f4599201..b536535f5 100644
Binary files a/docs/astro/src/assets/guides/zh/lighting.png and b/docs/astro/src/assets/guides/zh/lighting.png differ
diff --git a/docs/astro/src/assets/guides/zh/localization.png b/docs/astro/src/assets/guides/zh/localization.png
index f4c4f3c0e..ca3ba14ab 100644
Binary files a/docs/astro/src/assets/guides/zh/localization.png and b/docs/astro/src/assets/guides/zh/localization.png differ
diff --git a/docs/astro/src/assets/guides/zh/marker-inspector.png b/docs/astro/src/assets/guides/zh/marker-inspector.png
index 200fff485..7251da5c0 100644
Binary files a/docs/astro/src/assets/guides/zh/marker-inspector.png and b/docs/astro/src/assets/guides/zh/marker-inspector.png differ
diff --git a/docs/astro/src/assets/guides/zh/material-shader.png b/docs/astro/src/assets/guides/zh/material-shader.png
index 608b4b93a..5b1e98895 100644
Binary files a/docs/astro/src/assets/guides/zh/material-shader.png and b/docs/astro/src/assets/guides/zh/material-shader.png differ
diff --git a/docs/astro/src/assets/guides/zh/nine-slice-drag.png b/docs/astro/src/assets/guides/zh/nine-slice-drag.png
index a92f0dc52..784704e27 100644
Binary files a/docs/astro/src/assets/guides/zh/nine-slice-drag.png and b/docs/astro/src/assets/guides/zh/nine-slice-drag.png differ
diff --git a/docs/astro/src/assets/guides/zh/orient-hex.png b/docs/astro/src/assets/guides/zh/orient-hex.png
index 674e2d2de..014be1256 100644
Binary files a/docs/astro/src/assets/guides/zh/orient-hex.png and b/docs/astro/src/assets/guides/zh/orient-hex.png differ
diff --git a/docs/astro/src/assets/guides/zh/orient-staggered.png b/docs/astro/src/assets/guides/zh/orient-staggered.png
index cb9c2e9be..9ccd3cd7a 100644
Binary files a/docs/astro/src/assets/guides/zh/orient-staggered.png and b/docs/astro/src/assets/guides/zh/orient-staggered.png differ
diff --git a/docs/astro/src/assets/guides/zh/outliner-prefab-menu.png b/docs/astro/src/assets/guides/zh/outliner-prefab-menu.png
new file mode 100644
index 000000000..e34e58d7f
Binary files /dev/null and b/docs/astro/src/assets/guides/zh/outliner-prefab-menu.png differ
diff --git a/docs/astro/src/assets/guides/zh/particle-view.png b/docs/astro/src/assets/guides/zh/particle-view.png
index b4272e083..9a2f41df3 100644
Binary files a/docs/astro/src/assets/guides/zh/particle-view.png and b/docs/astro/src/assets/guides/zh/particle-view.png differ
diff --git a/docs/astro/src/assets/guides/zh/physics-collider.png b/docs/astro/src/assets/guides/zh/physics-collider.png
index 1ae328495..9af9cd8dc 100644
Binary files a/docs/astro/src/assets/guides/zh/physics-collider.png and b/docs/astro/src/assets/guides/zh/physics-collider.png differ
diff --git a/docs/astro/src/assets/guides/zh/prefab-mode.png b/docs/astro/src/assets/guides/zh/prefab-mode.png
index 56a387fae..5ebb95f0e 100644
Binary files a/docs/astro/src/assets/guides/zh/prefab-mode.png and b/docs/astro/src/assets/guides/zh/prefab-mode.png differ
diff --git a/docs/astro/src/assets/guides/zh/prefab-virtual-toggle.png b/docs/astro/src/assets/guides/zh/prefab-virtual-toggle.png
new file mode 100644
index 000000000..379f2bf87
Binary files /dev/null and b/docs/astro/src/assets/guides/zh/prefab-virtual-toggle.png differ
diff --git a/docs/astro/src/assets/guides/zh/seq-curves.png b/docs/astro/src/assets/guides/zh/seq-curves.png
index 1ee8e3f96..f43bab9d1 100644
Binary files a/docs/astro/src/assets/guides/zh/seq-curves.png and b/docs/astro/src/assets/guides/zh/seq-curves.png differ
diff --git a/docs/astro/src/assets/guides/zh/seq-dopesheet.png b/docs/astro/src/assets/guides/zh/seq-dopesheet.png
index fdfe6748b..82d657404 100644
Binary files a/docs/astro/src/assets/guides/zh/seq-dopesheet.png and b/docs/astro/src/assets/guides/zh/seq-dopesheet.png differ
diff --git a/docs/astro/src/assets/guides/zh/settings-runtime.png b/docs/astro/src/assets/guides/zh/settings-runtime.png
new file mode 100644
index 000000000..a24419a0b
Binary files /dev/null and b/docs/astro/src/assets/guides/zh/settings-runtime.png differ
diff --git a/docs/astro/src/assets/guides/zh/settings-screen-presets.png b/docs/astro/src/assets/guides/zh/settings-screen-presets.png
index fc11156f0..bfe7a5309 100644
Binary files a/docs/astro/src/assets/guides/zh/settings-screen-presets.png and b/docs/astro/src/assets/guides/zh/settings-screen-presets.png differ
diff --git a/docs/astro/src/assets/guides/zh/settings-shader-compilation.png b/docs/astro/src/assets/guides/zh/settings-shader-compilation.png
new file mode 100644
index 000000000..c3989d7ed
Binary files /dev/null and b/docs/astro/src/assets/guides/zh/settings-shader-compilation.png differ
diff --git a/docs/astro/src/assets/guides/zh/steam-channel.png b/docs/astro/src/assets/guides/zh/steam-channel.png
index 59c596e16..560df2a65 100644
Binary files a/docs/astro/src/assets/guides/zh/steam-channel.png and b/docs/astro/src/assets/guides/zh/steam-channel.png differ
diff --git a/docs/astro/src/assets/guides/zh/tilemap-new.png b/docs/astro/src/assets/guides/zh/tilemap-new.png
index 2c6d1436f..4fba09095 100644
Binary files a/docs/astro/src/assets/guides/zh/tilemap-new.png and b/docs/astro/src/assets/guides/zh/tilemap-new.png differ
diff --git a/docs/astro/src/assets/guides/zh/tilemap-overview.png b/docs/astro/src/assets/guides/zh/tilemap-overview.png
index a2d11ec17..1b41191b4 100644
Binary files a/docs/astro/src/assets/guides/zh/tilemap-overview.png and b/docs/astro/src/assets/guides/zh/tilemap-overview.png differ
diff --git a/docs/astro/src/assets/guides/zh/tilemap-tools.png b/docs/astro/src/assets/guides/zh/tilemap-tools.png
index 7262d882d..cdc4c8493 100644
Binary files a/docs/astro/src/assets/guides/zh/tilemap-tools.png and b/docs/astro/src/assets/guides/zh/tilemap-tools.png differ
diff --git a/docs/astro/src/assets/guides/zh/tileset-animation.png b/docs/astro/src/assets/guides/zh/tileset-animation.png
index b7b9e3ae3..59082dfd5 100644
Binary files a/docs/astro/src/assets/guides/zh/tileset-animation.png and b/docs/astro/src/assets/guides/zh/tileset-animation.png differ
diff --git a/docs/astro/src/assets/guides/zh/tileset-collision.png b/docs/astro/src/assets/guides/zh/tileset-collision.png
index 03ca389fe..6e81046dc 100644
Binary files a/docs/astro/src/assets/guides/zh/tileset-collision.png and b/docs/astro/src/assets/guides/zh/tileset-collision.png differ
diff --git a/docs/astro/src/assets/guides/zh/tileset-terrain.png b/docs/astro/src/assets/guides/zh/tileset-terrain.png
index 0674fa9e8..978ac0019 100644
Binary files a/docs/astro/src/assets/guides/zh/tileset-terrain.png and b/docs/astro/src/assets/guides/zh/tileset-terrain.png differ
diff --git a/docs/astro/src/assets/guides/zh/ui-screen.png b/docs/astro/src/assets/guides/zh/ui-screen.png
index efbbde1f3..1c1805989 100644
Binary files a/docs/astro/src/assets/guides/zh/ui-screen.png and b/docs/astro/src/assets/guides/zh/ui-screen.png differ
diff --git a/docs/astro/src/assets/guides/zh/widgets-gallery.png b/docs/astro/src/assets/guides/zh/widgets-gallery.png
index 7b95229fd..b256aa69a 100644
Binary files a/docs/astro/src/assets/guides/zh/widgets-gallery.png and b/docs/astro/src/assets/guides/zh/widgets-gallery.png differ
diff --git a/docs/astro/src/content/docs/animation/spring-bones.mdx b/docs/astro/src/content/docs/animation/spring-bones.mdx
index d927e9702..5930afe25 100644
--- a/docs/astro/src/content/docs/animation/spring-bones.mdx
+++ b/docs/astro/src/content/docs/animation/spring-bones.mdx
@@ -1,6 +1,6 @@
---
title: Spring bones
-description: Secondary motion for chains of bones (hair, tails, cords): a SpringBone on the chain's root, SpringBoneCollider shapes to keep it out of, and what it costs.
+description: "Secondary motion for chains of bones (hair, tails, cords): a SpringBone on the chain's root, SpringBoneCollider shapes to keep it out of, and what it costs."
---
Hair, tails, scarves and cords move after the body does: they lag it, swing, and settle. **Spring bones** add that to a skeleton without an animator
diff --git a/docs/astro/src/content/docs/assets/models.mdx b/docs/astro/src/content/docs/assets/models.mdx
index 3c8735d44..69852a165 100644
--- a/docs/astro/src/content/docs/assets/models.mdx
+++ b/docs/astro/src/content/docs/assets/models.mdx
@@ -209,6 +209,10 @@ Metal and roughness are written even when they match the engine's own defaults:
defaults both factors to 1 (a fully rough metal) and the shader defaults metal to 0, so a
product that left them out would describe a surface the source did not.
+A texture the material names that is not in the project (the file is missing next to the
+model) is left off: the model imports without it and a warning says so, instead of keeping a
+reference that fails to load on every use.
+
The material also restates the draw's blending, depth and culling, because a material
replaces them — a model told to occlude itself keeps doing so through its material.
diff --git a/docs/astro/src/content/docs/assets/overview.mdx b/docs/astro/src/content/docs/assets/overview.mdx
index 8fe835733..17a2c3d74 100644
--- a/docs/astro/src/content/docs/assets/overview.mdx
+++ b/docs/astro/src/content/docs/assets/overview.mdx
@@ -285,12 +285,19 @@ When the graphics context is lost (a driver reset, a mobile browser reclaiming
the GPU), the engine rebuilds every texture and buffer behind the handles your
game holds. Most content comes back from where it came from — an asset is
loaded again, a text page is repainted from its glyphs, a skeleton's atlas page
-is decoded again. What has no such source (a mesh built at runtime, a tile
+is decoded again, a terrain's layer textures are read and packed again from their files and its page atlases refilled. What has no such source (a mesh built at runtime, a tile
collection composed at load) is kept as a CPU copy, which counts against your
memory but not against any GPU figure. `stats.retainedBytes` is that copy; the
engine's own is about 28 KB. It warns once when the copy grows past
`RuntimeConfig.retainedBudget` (**16 MB** by default, `retainedBudget` in the
-build config, or `setRetainedBudget(bytes)`; 0 never warns).
+build config, or `setRetainedBudget(bytes)`; 0 never warns). Content the engine
+can make again is not kept twice: a terrain with texture layers holds no CPU copy of them.
+
+Recovery is one transaction of the device, and a web game comes back to the picture it
+had. While the engine waits for its textures, frames the device refuses start empty and
+collect nothing, so their staging does not grow; and the restored WebGL context is given
+its extensions again before the device probes what it can do, so an HDR scene does not
+come back black.
What the engine cannot put back is content **your game drew**: a render texture
is GPU storage, so a rebuilt device hands it back blank. `onDeviceRestored` says
diff --git a/docs/astro/src/content/docs/editor/cocos-import.mdx b/docs/astro/src/content/docs/editor/cocos-import.mdx
new file mode 100644
index 000000000..7336fff44
--- /dev/null
+++ b/docs/astro/src/content/docs/editor/cocos-import.mdx
@@ -0,0 +1,108 @@
+---
+title: Importing a Cocos Creator project
+description: "Open a Cocos Creator 3.x project in the editor, what the conversion carries over, how re-import keeps your edits, and the cc compatibility layer that runs the project's scripts."
+---
+
+import { Aside } from '@astrojs/starlight/components';
+
+The editor can bring a **Cocos Creator 3.x** project across: its scenes, prefabs, scripts and
+assets become an Estella project that you keep editing here. The Cocos folder is only ever read.
+
+## Open a Cocos project
+
+Choose a Cocos Creator folder in **Open Project**. The editor recognises it by the Creator
+version in its `package.json` and offers to convert it into a new project beside it, named
+`<name>-estella`, and then opens that. Opening the same Cocos folder again opens the converted
+project instead of converting twice.
+
+The conversion shows its progress: the stage it is in and how far through it is, in a bar over the
+window. It runs off the editor's main thread, so the window does not freeze.
+
+- **Images, fonts and spine files are linked, not copied.** They are hard-linked into the converted
+ project (copied only across drives), so a multi-gigabyte art folder is neither duplicated nor
+ stored twice. The project reads those files and never writes into them.
+- **The project starts as the game does.** It opens at the Cocos launch scene with the Cocos
+ design size, and scripts that only define globals (the game configuration) run before the ones
+ scenes name. Editor built-in assets that a scene names by uuid, such as the default progress bar
+ images, are read from your Creator install.
+- **Components that did not come across are listed.** After the first conversion, a message lists
+ the components that have no counterpart, most used first. Their data is kept on the entity, but
+ nothing runs for them.
+- **The Cocos project's own effects are converted** into Estella shaders and materials, so a sprite,
+ mesh or particle that used one keeps its look.
+
+## What the conversion keeps
+
+**Screen fit.** The Cocos design fit (fit width, fit height) becomes the project camera's scale
+mode (fixed width, fixed height), so a UI laid out in design units comes out the same size on every
+screen. See [Screen & Design Resolution](/docs/core-concepts/screen/).
+
+**Layers.** A node's Cocos layer becomes the layer of its sprites, texts, shapes, spine, particles and
+meshes (the layer's bit index), which is what a camera's culling mask selects among. A UI camera
+that draws only one layer therefore draws what it did in Cocos.
+
+**UI.** Converted UI behaves as it does in Cocos:
+
+- The UI layer is painted in hierarchy order, so a popup covers the text of the view under it
+ (see [hierarchy-order layers](/docs/graphics/sprites/#hierarchy-order-layers)).
+- `Widget` becomes the engine's [`RectAnchors`](/docs/ui/overview/#rectanchors--world-content-that-follows-its-parent)
+ on a [`ContentRect`](/docs/ui/overview/#contentrect--a-rectangle-for-world-content), so the scene is
+ laid out in the editor where it will run. A root pinned to the screen is stored where the engine
+ places it in the design box. The Cocos `Layout` runs between the engine's two anchor passes.
+- A Label with no overflow rule does not wrap and is laid out from its anchor.
+- An `EditBox` becomes the engine's text field with its two labels folded in.
+- An inactive node becomes the `Disabled` tag, and its subtree goes with it.
+- Bitmap font pages keep their full size.
+
+**Scripts.** Each script's component classes are declared to the editor, so they reach the
+Inspector. Scripts are bundled with Cocos's tolerated gaps (missing `cc` names, a reassigned
+`const`, package files outside `exports`, imports used only in preview). Two scripts that write the
+same `@ccclass` name are told apart: the second gets its own component name (`Name_2`, in path
+order), the converter writes which script that was beside the entry, and the bundler writes the new
+name into that script's decorator. The script bundle is rebuilt on Play only when a file it read
+changed.
+
+## Re-import without losing your edits
+
+Run **Re-import Cocos Project** in a project converted from Cocos Creator. Scenes and prefabs that
+changed on the Cocos side are brought across and new ones are added. A document you edited here is
+left as it is and counted in the result, for example *3 new, 2 updated, 5 kept because you edited
+them*. The one exception is `Cocos.Widget` components on an edited document, which are turned into
+`RectAnchors` (same fields), so a project converted by an older importer keeps its alignment.
+
+A converted project records the importer's revision. When the editor opens a project written by an
+older importer, it is converted again.
+
+Running the command in a project that did not come from Cocos tells you so and changes nothing.
+
+## The `cc` compatibility layer
+
+Cocos scripts keep working because the project's scripts are built with `cc` resolved to the
+engine's Cocos layer (`esengine/cocos`). A `Node` there is an entity and a `Component` subclass is an
+Estella component. Parts of Cocos with no counterpart are not simulated: a part of the `cc` module the
+layer does not provide is a stand-in that survives being read, called and constructed, and says
+once that it is missing, rather than `undefined`. Each script of a converted project loads on its
+own, so one whose module throws does not stop the others from registering.
+
+What is covered:
+
+| Area | Provided |
+|---|---|
+| Scenes and `director` | `director.loadScene` runs a project scene through the engine's scene manager (a persistent root is `SceneOwner.persistent`). A scene's components start in one phase before the frame's updates. `director` has a scheduler and fires its frame events, and is a class scripts can patch. A node's scripts load and enable as it joins an active parent or is switched on, and a node made between frames joins the running world. |
+| Nodes and components | `setSiblingIndex` reorders through the engine's entity order. `getComponent` finds a component by a base class it derives from, or by its `cc.` name. `Component.EventHandler`, `Node.getParent` and `Camera.screenPointToRay` exist. The design resolution is known to scripts before they run. |
+| Loading assets | `resources.load` gives images, sprite frames and audio by path, and finds an image's `spriteFrame` and `texture` by the end of the path. A directory load leaves out what the layer cannot load instead of failing. `loadAny` takes a uuid. A loaded asset is named for its file and counts its holders. `assetManager` has a downloader, a factory and `AssetManager.Cache`. |
+| Meshes and materials | `MeshRenderer` is a view on the engine's mesh renderer: `getSharedMaterial`, `getMaterialInstance` (the per-renderer instance, made once), `material`, `setMaterial`. `Material.setProperty` / `getProperty` write through to the engine material (colours 0..255 become 0..1); `mainColor`, `albedo`, `baseColor` and `color` write the renderer's tint. `ModelRenderer`, `UIMeshRenderer` and `cc.geometry` (`AABB`, `Ray`, `Plane` and the box, ray and plane tests) exist. |
+| Utilities | `js` (class names and lookup, `isChildClassOf`, `mixin`, `addon`, property definers), `ccenum`, `NodePool` (the handler component is told `unuse` and `reuse`), `cc.profiler` (`showStats`, `hideStats`). |
+| UI components | Widget, Layout, Button, Toggle (a toggle belongs to the container its parent holds; assigning `isChecked` switches the others of its group off), ProgressBar, ScrollView, Label, Sprite, EditBox and the rest of the layer. Sprites, labels and graphics accept the rebuild requests scripts send. |
+
+<Aside type="note">
+ Where two pressable things overlap at the same depth and layer, a press goes to the one drawn
+ later by its place in the hierarchy, so a node taken from a pool and added under a panel does not
+ take presses meant for what covers it.
+</Aside>
+
+## See also
+
+- [Prefabs](/docs/world/prefabs/) — virtual instances, which keep a screen of many pages cheap.
+- [UI overview](/docs/ui/overview/) — `ContentRect`, `RectAnchors` and `UIPages`.
+- [Screen & Design Resolution](/docs/core-concepts/screen/)
diff --git a/docs/astro/src/content/docs/editor/overview.mdx b/docs/astro/src/content/docs/editor/overview.mdx
index 47e14069c..9f3da939b 100644
--- a/docs/astro/src/content/docs/editor/overview.mdx
+++ b/docs/astro/src/content/docs/editor/overview.mdx
@@ -49,7 +49,7 @@ The default layout, from the outside in:
- **World Outliner** (right) — the scene's entity hierarchy.
- **Details** (right) — the inspector for the current selection.
- **Content Browser**, **Output Log** and **Profiler** (bottom tabs). Other panels — the Sequencer, the Tile Palette — open when you need them, from the Panels menu or the mode that owns them.
-- **Status Bar** — the Content Drawer toggle, edit mode, whether the scene is saved, the loaded modules, FPS, entity count, memory, the graphics backend, and the engine version.
+- **Status Bar** — the Content Drawer toggle, edit mode, whether the scene is saved, the loaded modules, FPS, entity count, memory, the graphics backend, and the engine version. Each readout stays on one line; when the bar is short of room it drops the long message and the least useful readouts rather than wrapping.
Panels are dockable — drag a tab to re-arrange, split, or float it, and the layout is
saved automatically. You can also summon the Content Browser as a slide-up overlay
diff --git a/docs/astro/src/content/docs/editor/play.mdx b/docs/astro/src/content/docs/editor/play.mdx
index 94b915f8f..14ea11343 100644
--- a/docs/astro/src/content/docs/editor/play.mdx
+++ b/docs/astro/src/content/docs/editor/play.mdx
@@ -31,11 +31,13 @@ fold and hide rows, but not rename, reparent, create or delete.
## Moving things while the game runs
-The selected entity is outlined on the running frame. Turn on **Inspect** (above the
-game) and the pointer belongs to the editor instead of the game: click to select what is
+Turn on **Inspect** (above the game, or **F8**) and the selected entity is outlined on
+the running frame, and the pointer belongs to the editor instead of the game: click to select what is
under it, then move, turn or resize it with the transform tools, which appear beside the
frame while Inspect is on and answer to the same **W / E / R** keys they do when
-editing. It is off by default, because a game you cannot click is not a game.
+editing. It is off by default, because a game you cannot click is not a game. With
+Inspect off nothing is drawn over the running game; a new selection shows where it is
+for a moment.
The running world is what answers all of this — where the entity is drawn, what is under
the pointer, where a drag lands — so it is the game's own camera doing the projection,
@@ -68,6 +70,10 @@ inspect connection or reload errors. Close the popover or settings to keep
previewing; Stop, switching projects or closing the editor invalidates the link.
Each session generates a new access token. This preview has no public tunnel.
+The page on the phone may connect wherever Play may, so a game that logs in to a server
+on your LAN works there too. A shipping web export is stricter: it connects only to the
+servers listed in **Project Settings → Allowed server origins**.
+
Saving scenes or assets rebuilds and refreshes connected browsers. Script saves
use the existing schema probe and system hot swap to retain the running world
when compatible. Structural changes reload the page and report why. A failed
diff --git a/docs/astro/src/content/docs/editor/scenes.mdx b/docs/astro/src/content/docs/editor/scenes.mdx
index 2bfa5facf..4d69d21d0 100644
--- a/docs/astro/src/content/docs/editor/scenes.mdx
+++ b/docs/astro/src/content/docs/editor/scenes.mdx
@@ -32,6 +32,11 @@ The Outliner is the scene's hierarchy. You can:
loads. Locking leaves it visible and selectable but gives it no handles: the
viewport won't pick it, and the transform gizmo won't appear for it.
- **Create Prefab** from a selection, then drop instances back into the scene.
+- Right-click a prefab instance for **Edit Prefab**, **Apply to Prefab**, **Revert to
+ Prefab**, **Create Variant** and **Unpack Prefab**, and **Make Virtual (load on demand)** /
+ **Make Whole (load with the scene)**. A virtual instance is shown and edited whole here
+ but a running scene builds only its root — see
+ [Virtual instances](/docs/world/prefabs/#virtual-instances).
## The Details panel
@@ -47,6 +52,9 @@ Each component is a **collapsible section**, and the panel remembers what you fo
across reselects *and* editor restarts — so an inspector stays as tidy as you leave it.
Rarely-touched "chrome" (a widget's `Focusable` and `ThemeStyle` tags) starts folded.
+On a prefab instance, the prefab bar at the top of Details carries the **Virtual** toggle
+described above.
+
Where a visual control beats a row of raw numbers, Details shows a **purpose-built
widget** — most of them for UI nodes:
diff --git a/docs/astro/src/content/docs/editor/settings.mdx b/docs/astro/src/content/docs/editor/settings.mdx
index cc336f8d5..c3b9dfe31 100644
--- a/docs/astro/src/content/docs/editor/settings.mdx
+++ b/docs/astro/src/content/docs/editor/settings.mdx
@@ -17,24 +17,55 @@ setting on any page.
- **Game** — **Display** (the project design resolution, which seeds new Canvases and
drives the device preview in any scene; the project-wide **screen orientation**, which
every export target honors and which, unset, is derived from the design resolution's
- aspect; and the **camera fit**, how the main camera scales the design resolution
- without a UI Canvas — `None` = off), **UI** (the widget **theme**, dark or light, and
+ aspect; the **camera fit**, how the main camera scales the design resolution
+ without a UI Canvas — `None` = off; and the **render resolution**, whether the scene is
+ drawn at the screen's size, at the design resolution or at an integer multiple of it and
+ then scaled to the screen), **UI** (the widget **theme**, dark or light, and
per-role **Theme Colors** overrides, applied identically in the editor, Play, and every
- export — see [UI widgets — theming](/docs/ui/widgets/#theming)), **Audio** and **Spine**.
+ export — see [UI widgets — theming](/docs/ui/widgets/#theming)), **Audio**, **Spine** and **Runtime** (the engine's tuning, below).
- **Rendering** — up to thirty-two named sorting layers that populate the inspector's
layer dropdown, and which of them y-sort. The names are suggestions, not a limit:
a render `layer` still accepts a number outside them. Quality tiers and the project
- environment live here too.
+ environment live here too, with the choices about delivery: compiling shaders in the
+ background, warming them up behind the loading screen, and drawing only frames that
+ change (see [Quality levels](/docs/performance/quality-levels/#shader-compilation-and-render-on-demand)).
- **Physics** — enable, gravity, sixteen collision-layer names and a 16×16 collision
matrix, plus solver tuning (fixed timestep, sub-steps, contact Hz/damping/push
speed, sleeping, continuous collision). See [Physics](/docs/gameplay/physics/).
- **Build and modules** — per-target packaging metadata (WeChat AppID, Desktop app id /
- product name, splash, achievements) and the engine modules the project includes.
+ product name, splash, achievements), the engine modules the project includes and, for
+ the web build, the **allowed server origins** — the servers (`wss://play.example.com`) the
+ page may open connections to. Without any, the page's Content-Security-Policy allows only
+ its own origin.
+ - **Configuration tables** — the optional **Luban** (designers keep tables in Excel; the
+ editor generates the JSON and TypeScript the game reads) and **Protobuf** (messages written
+ in `.proto` files become TypeScript types and a compact binary codec) tools. Each is off by
+ default: off, the editor looks for nothing and downloads nothing; on, it checks the tool is
+ installed (asking before it downloads anything) and keeps the generated code current.
Settings you set once and then leave alone — screen presets, solver tuning, the theme's
colors, the module switches, the endpoints of your own AI providers — sit under a page's
**Advanced** fold, so a page's body is what people actually touch.
+## Runtime
+
+**Project → Game → Runtime** holds the engine's own tuning, which used to be reachable only
+from code. The project file keeps only what differs from the engine's values, in
+`features.runtime`; every build ships the same block and Play applies it before the first
+asset loads. The edit viewport keeps the engine's values.
+
+![Project Settings, Game page, Runtime section: the Scene Transition, Frame Limits, Cache Budgets and Text groups](@/assets/guides/en/settings-runtime.png)
+
+The settings used least sit under the page's **Advanced** fold: **Most fixed steps per frame**, **Load timeout**, **Retry cooldown**, **Device-loss copies** and **Text canvas size**.
+
+| Group | Settings |
+|---|---|
+| **Scene Transition** | **Duration** (default 0.3 s) and **Colour** of the fade a scene switch uses when the call names none. |
+| **Frame Limits** | **Longest frame step** (0.25 s): a frame that took longer — a tab in the background, a stall — advances the game by this much, not by the time that really passed. **Most fixed steps per frame** (8): the cap on catch-up steps of the fixed-rate update (physics); past it the simulation slows down instead of spiralling. |
+| **Asset Loading** | **Load timeout** (30 s) before one asset's load fails, and **Retry cooldown** (5 s) before a failed asset is tried again. |
+| **Cache Budgets** | Memory kept for **Texture cache** (64 MiB of GPU memory for textures nothing uses right now), **Audio cache** (32 MiB of decoded clips) and **Device-loss copies** (16 MiB of CPU copies the device keeps to survive losing the GPU, past which it warns). 0 turns the first two off. |
+| **Text** | **Text canvas size** (512) the text is rasterised on, and the **Default font family** for a Text with none of its own. |
+
## Editor language
The editor ships in **English** and **简体中文** and follows your system language on
diff --git a/docs/astro/src/content/docs/editor/shortcuts.mdx b/docs/astro/src/content/docs/editor/shortcuts.mdx
index 7456f8373..64f8514e1 100644
--- a/docs/astro/src/content/docs/editor/shortcuts.mdx
+++ b/docs/astro/src/content/docs/editor/shortcuts.mdx
@@ -25,10 +25,14 @@ Settings → Editor → Shortcuts.
| Frame Selected | `F` |
| Play · Stop | `F5` · `Esc` |
| Pause/Resume · Restart | `F6` · `shift + F5` |
+| Inspect While Playing (toggle) | `F8` |
| Maximize / restore viewport | `F11` |
+| Package Project… | `mod + shift + B` |
+| Go to Anything… | `mod + P` |
| Command Palette | `mod + shift + P` |
| Content Drawer | `Ctrl + Space` |
| Project Settings | `mod + ,` |
+| Zoom interface in / out / reset | `mod + =` / `mod + -` / `mod + 0` |
The **Command Palette** (`mod + shift + P`) fuzzy-searches every runnable command —
the fastest way to reach any action without hunting through menus.
diff --git a/docs/astro/src/content/docs/gameplay/physics-3d.mdx b/docs/astro/src/content/docs/gameplay/physics-3d.mdx
index 7752c20bf..957fb1345 100644
--- a/docs/astro/src/content/docs/gameplay/physics-3d.mdx
+++ b/docs/astro/src/content/docs/gameplay/physics-3d.mdx
@@ -42,6 +42,10 @@ cmds.spawn()
| `SphereCollider3D` | `radius`. |
| `CapsuleCollider3D` | An upright capsule: `halfHeight` is the cylinder's half, with a cap of `radius` on each end, so the total height is `2 * (halfHeight + radius)`. |
+Each of the three also takes an optional `center`: the shape's place from the entity origin, in world
+units (default `{ 0, 0, 0 }`). The body stays at the entity, so a dynamic body turns about its origin and
+an off-centre shape swings round it.
+
<Aside>
Sizes are authored in **world units** and reach the solver in metres, at the same
`pixelsPerUnit` the 2D world uses (100 by default). A solver tuned for metres
diff --git a/docs/astro/src/content/docs/graphics/materials.mdx b/docs/astro/src/content/docs/graphics/materials.mdx
index b2b8f0b47..7ce4660a4 100644
--- a/docs/astro/src/content/docs/graphics/materials.mdx
+++ b/docs/astro/src/content/docs/graphics/materials.mdx
@@ -1,6 +1,6 @@
---
title: Materials & Shaders
-description: The complete guide to custom materials — authoring GLSL with reflected #pragma param uniforms, the Material API, and applying materials to renderers.
+description: "The complete guide to custom materials — authoring GLSL with reflected #pragma param uniforms, the Material API, and applying materials to renderers."
---
import { Aside } from '@astrojs/starlight/components';
@@ -188,6 +188,10 @@ varyings arrive ready to use:
| `v_texCoord` | `vec2` | Texture UV. |
| `v_worldPos` | `highp vec2` | World-space position (**Lit domain only**). |
+On a **mesh** that carries a second uv set (the `MESH_LIGHTMAP` variant), the vertex stage also hands the
+fragment `v_texCoord1` (`vec2`) — that second uv set exactly as authored, beside the lightmap coordinates
+the engine derives from it. A material that is not a bake can read it for a mask or a dissolve map.
+
The sprite's texture is `u_textures[0]` (declare `uniform sampler2D u_textures[8];`
— units 0–7 belong to the batch; texture *params* bind above them automatically).
@@ -228,6 +232,10 @@ The engine injects these into every compiled `.esshader` — never declare them
A `#pragma switch` selects a static shader permutation baked into the material at
compile time (via the `features` argument to `compileShader`).
+`#if` and `#elif` conditions may use `defined`, `!`, `&&`, `||` and parentheses, and resolve the same way in a
+shader's WGSL twin as in its GLSL, so a lit material on the engine's own vertex stage or a lit 2D shader draws on
+WebGPU as it does on WebGL2.
+
## Create & apply in code
Compile the shader **once** (not per frame), make a material, then point a renderer
diff --git a/docs/astro/src/content/docs/graphics/post-processing.mdx b/docs/astro/src/content/docs/graphics/post-processing.mdx
index 2fdb30bbf..24dd3ad80 100644
--- a/docs/astro/src/content/docs/graphics/post-processing.mdx
+++ b/docs/astro/src/content/docs/graphics/post-processing.mdx
@@ -95,9 +95,12 @@ clouds are still drawn where there is sky.
`rain` is a storm in two parts. **Falling rain** is three layers of thin slanted streaks scrolling down the
screen, each standing at its own distance: a streak is hidden by a surface nearer than its layer and drawn
-over one farther away, and the sky counts as infinitely far. **Wet ground** is found from the depth buffer —
-a surface that faces up, flat enough to hold water — and darkened by `wetness`, because water in the pores takes
-the light a dry surface scatters. Drops that land on it leave **ripples** (rings that spread and fade) and
+over one farther away, and the sky counts as infinitely far. **Wet surfaces** are everything the rain falls on,
+darkened by `wetness` because water in the pores takes the light a dry surface scatters. The darkening is full on
+ground that faces the sky and a little less (down to 0.6 of it) where a surface faces away, taken from the surface's own
+normal where the G-buffer has one (a leaf's) and from the depth buffer elsewhere, so a hillside and a plant in a storm
+darken with the flat ground beside them instead of standing out pale. What needs **flat ground** — a surface that faces
+up, flat enough to hold water — is the standing water and the drops that land on it, which leave **ripples** (rings that spread and fade) and
**splashes** (the small quick crown of a drop on ground that is not water), laid out on a grid in the world so they
stay on the ground when the camera moves. Ripples need drops: with `intensity` at 0 the ground is wet and still.
diff --git a/docs/astro/src/content/docs/graphics/sprites.mdx b/docs/astro/src/content/docs/graphics/sprites.mdx
index a3bc529d6..7452f661b 100644
--- a/docs/astro/src/content/docs/graphics/sprites.mdx
+++ b/docs/astro/src/content/docs/graphics/sprites.mdx
@@ -246,6 +246,12 @@ front of it — no manual `layer` or z juggling.
gameplay layer(s) that need it.
</Aside>
+### Hierarchy-order layers
+
+`Renderer.setTreeSortLayers(mask)` names the layers (bits 0–31) whose sprites, labels and shapes stack in
+the order of the hierarchy — a parent before its children, an earlier sibling's subtree before a later
+one's — instead of by shader and depth. Use it where a panel must cover the text of the panel under it.
+
### Fading a roof or a crown over the player
A roof, or a tree crown, drawn over the ground it covers hides whoever walks in. Put `CoverFade` on the covering sprite and `CoverFadeTarget` on the
diff --git a/docs/astro/src/content/docs/performance/profiling.mdx b/docs/astro/src/content/docs/performance/profiling.mdx
index 4feb01d86..161001b52 100644
--- a/docs/astro/src/content/docs/performance/profiling.mdx
+++ b/docs/astro/src/content/docs/performance/profiling.mdx
@@ -568,7 +568,11 @@ notifies on phase changes. The full lifecycle model is covered in
The desktop editor builds its profiling UI on these same surfaces: the
**Profiler panel** shows a live frame-time graph with per-phase and per-system
breakdowns (click a frame to inspect it), and the viewport has a small perf
-overlay for an at-a-glance FPS readout. For in-game builds, `statsPlugin` above
+overlay for an at-a-glance FPS readout. Click a column header of the cost tree or the
+systems list to order it by name or by time, and again to reverse it; the choice is
+remembered. Ranking by time moves a row whenever two systems pass each other, which on
+a live window is every few frames, so sort by name when you want to follow one system.
+The systems list names twelve systems. For in-game builds, `statsPlugin` above
is the equivalent.
## Best practices
diff --git a/docs/astro/src/content/docs/performance/quality-levels.mdx b/docs/astro/src/content/docs/performance/quality-levels.mdx
index b191aa8d7..a93770369 100644
--- a/docs/astro/src/content/docs/performance/quality-levels.mdx
+++ b/docs/astro/src/content/docs/performance/quality-levels.mdx
@@ -29,7 +29,7 @@ to.
| Group | Settings |
|---|---|
-| Rendering | Render scale, Min render scale, MSAA, Detail distance |
+| Rendering | Render scale, Min render scale, Anti-aliasing (MSAA or Temporal), MSAA, Depth pre-pass, Detail distance |
| Shadows | Atlas size, Cell size, Cascades, Distance |
| Reflections and particles | Planar reflection scale, max size and updates per second, Particle limit |
| Post-processing | A master switch, and a tick for each effect that runs at this level |
@@ -38,6 +38,12 @@ Each level starts from the engine's own values for it, and **only what you chang
under `features.rendering.quality.profiles.<level>`. A default the engine improves later reaches a project that never
touched it, and a row set back to its level's default is not a difference.
+**Anti-aliasing** is MSAA or Temporal. Temporal draws at one sample and lets the TAA pass smooth from the frames before:
+far cheaper at 1080p and somewhat softer, it needs a post-process volume on the camera, and the MSAA row is hidden while it
+is chosen. **Depth pre-pass** draws the opaque scene twice, depth alone first, so each pixel is shaded once for the surface in
+front. It pays where surfaces overlap (a wood, a crowd of foliage) on a GPU that shades what it rasterises; on one that defers
+shading to the end of a tile it is geometry paid for twice. It is off at Low and on at Medium and High. The pre-pass and the colour pass declare the vertex position invariant on both WebGL2 and WebGPU, so a surface's colour always passes the equal-depth test against its own depth, including on Metal; a Mac that showed dark triangles on terrain with the pre-pass on needs nothing but an up-to-date build.
+
<Aside type="note">
A row's "default" is the default of the level it is showing, so the same number can be a change at Low and the default
at Medium.
@@ -68,6 +74,32 @@ Shown when the mode is Auto. Each row names a level and the conditions a device
**GPU contains**, **Max RAM** and **Max cores**, all of which must hold. The first row that matches decides the level. A
row with no condition would match every device, so it must have one.
+## Shader compilation and render on demand
+
+Two groups on the same page hold choices about how a game is *delivered* rather than which level it runs at. They apply
+whatever the quality level, **Off** included, and are saved under `features.rendering.quality`.
+
+![Project Settings, Rendering page: the Shader Compilation, Render on Demand, Power Saving and Antialiasing groups](@/assets/guides/en/settings-shader-compilation.png)
+
+**Shader Compilation**
+
+| Setting | What it does |
+|---|---|
+| **Compile shaders in the background** (`asyncShaderCompile`) | A draw whose shader the browser is still compiling is left out, so the game opens at once and fills in as shaders are ready. Off, the first draw to need a shader waits for it: every frame is complete, but a first visit can stall for seconds. Needs `KHR_parallel_shader_compile`; without it shaders compile as before. |
+| **Warm up behind the loading screen** (`prewarmShaders`) | Draws the first scene out of sight, behind the loading screen, until no shader is compiling, then opens on a complete picture. Shown once background compilation is on. |
+| **Warm-up timeout** | The longest the loading screen waits (in seconds, default 30) before opening anyway. Shown once warm-up is on. |
+
+**Render on Demand**
+
+| Setting | What it does |
+|---|---|
+| **Draw only changing frames** (`renderOnDemand`) | A still screen costs the game's logic and nothing else. A frame is drawn when something asked for it, the player did something, the surface changed size, entities were created or destroyed, or shaders are still compiling. |
+| **Frames kept after a change** (`renderOnDemandTail`) | Frames still drawn after the last reason to draw, so a fade or a settling motion finishes. Default 30. |
+
+The engine cannot see what a script changes by itself (a colour, an animation). Say so with `RenderDemand.request()` for
+one frame, or `RenderDemand.hold()` (it returns the function that releases it) for something that moves on its own, or
+that change is not drawn until something else wakes the screen. That is why the switch is opt-in.
+
## Saving power
A long session on a phone is heat and battery, and the frame is where both go. Turn on **Save power when the battery is low or the device is hot** (`QualityConfig.power`) and the engine
diff --git a/docs/astro/src/content/docs/publishing/android-ios.mdx b/docs/astro/src/content/docs/publishing/android-ios.mdx
index 61b3eabb8..db8abd59c 100644
--- a/docs/astro/src/content/docs/publishing/android-ios.mdx
+++ b/docs/astro/src/content/docs/publishing/android-ios.mdx
@@ -209,6 +209,7 @@ behaves exactly as it does in a browser.
| Audio | Native mixer ([miniaudio](https://miniaud.io/)) — CoreAudio / AAudio |
| Text input | The platform's **soft keyboard** is the field's editing surface |
| Networking | The OS network stack (`NSURLSession` / `HttpURLConnection`) |
+| Terrain and streamed worlds | Run on the native runtime. A terrain's layer textures go to the device as bytes, as every other texture does (a device has no wasm heap to copy them through), and a chunked world's maker uses a cancellation handle of its own, because QuickJS has no `AbortController` |
| Compressed textures | KTX2 transcoded to the device's format (ASTC → ETC2 → BC), with mip chains |
| Lifecycle | `onShow` / `onHide` and OS memory warnings reach the app |
diff --git a/docs/astro/src/content/docs/publishing/overview.mdx b/docs/astro/src/content/docs/publishing/overview.mdx
index 8faf00350..6e78879cd 100644
--- a/docs/astro/src/content/docs/publishing/overview.mdx
+++ b/docs/astro/src/content/docs/publishing/overview.mdx
@@ -90,7 +90,7 @@ Xcode, because only Apple can sign for a device.
With asset optimization set to **Auto**, playable exports first honor PNG **Max Size** (including enabled `playable` overrides) and each WAV clip's bitrate. If the assembled package exceeds the smallest of the network limit, project delivery budget and **3 MiB regression target**, the exporter tries lossless WebP, lower eligible audio bitrates (128 then 96 kbps), then WebP quality 90 and 80. Each candidate is measured as actual HTML and ZIP; optimization stops when both delivery and any HTML limit are met. Images retain their cooked dimensions and alpha; pixel art using nearest filtering, bitmap-font pages and data textures only use lossless encoding. PNGs with gamma/color-profile metadata, animation or 16-bit samples stay PNG, preserving their rendering semantics. Texture/audio compression opt-outs are honored, and **Skip** preserves source payloads.
-The export's check report and editor result show baseline/selected sizes and each selected encoding. The 3 MiB target is an internal regression target, not a claim about a network's official limit. If the target cannot be met at the quality floor, the report says so; actual network HTML limits still fail export. WebP uses the bundled ffmpeg encoder, with a warning and unchanged images if unavailable. Sources and import settings remain unchanged. Review image/audio quality and test the delivered package in the official container before publishing; size success does not prove platform acceptance.
+The export's check report and editor result show baseline/selected sizes and each selected encoding. The 3 MiB target is an internal regression target, not a claim about a network's official limit. If the target cannot be met at the quality floor, the report says so; an `index.html` over the network's uncompressed HTML limit is written anyway, with a warning that gives its size — whether to slim it or ship it is your call, not a failed build. When the parts no encoder can shrink (fonts and other files) are already over the target, the optimization search is skipped and the package is built as it is, with its size and contents reported; each stage reports its progress. WebP uses the bundled ffmpeg encoder, with a warning and unchanged images if unavailable. Sources and import settings remain unchanged. Review image/audio quality and test the delivered package in the official container before publishing; size success does not prove platform acceptance.
Every network takes the same single HTML file but disagrees on three things: how big
it may be, what must sit in `<head>`, and which function sends the player to the
diff --git a/docs/astro/src/content/docs/ui/controllers.mdx b/docs/astro/src/content/docs/ui/controllers.mdx
index f36f270c3..4a4cd96e2 100644
--- a/docs/astro/src/content/docs/ui/controllers.mdx
+++ b/docs/astro/src/content/docs/ui/controllers.mdx
@@ -85,6 +85,8 @@ keyed by page name: a page with no entry leaves the field untouched.
**Values** — numbers, colours (`{r,g,b,a}`), and vectors (`{x,y,z}`) interpolate when the
binding has a `tween`; strings and booleans always snap. A geared element is owned by the
controller for that field: on each page change the gear applies the page's value.
+A frame in which no controller, gear or parent changed, the world's structure is the same and no
+tween is in flight costs nothing, so a still screen with thousands of gears stays cheap.
<Aside type="note">
Gears apply in **edit mode too** — the system that applies them isn't gated to play. So
diff --git a/docs/astro/src/content/docs/ui/interaction.mdx b/docs/astro/src/content/docs/ui/interaction.mdx
index 11140b8e8..a8669c192 100644
--- a/docs/astro/src/content/docs/ui/interaction.mdx
+++ b/docs/astro/src/content/docs/ui/interaction.mdx
@@ -42,6 +42,10 @@ const onTiles = defineSystem([Query(Interactable, UIInteraction)], (q) => {
});
```
+Where two pressable nodes overlap at the same depth and layer, the hit goes to the one **drawn
+later** — decided by its place in the hierarchy, not by creation order. So a node taken from a pool
+and added under a panel does not steal presses meant for what covers it.
+
While any UI node is hit, `input.isPointerOverUI()` is `true` — the standard
guard that keeps a button click from also firing a world click.
diff --git a/docs/astro/src/content/docs/ui/overview.mdx b/docs/astro/src/content/docs/ui/overview.mdx
index 81c8f92c7..98f2b0a40 100644
--- a/docs/astro/src/content/docs/ui/overview.mdx
+++ b/docs/astro/src/content/docs/ui/overview.mdx
@@ -183,6 +183,58 @@ An entity with both a `UINode` and a `ContentRect` keeps the layout's box for cl
Adding a `Sprite` or `Text` to an entity that already has a rect: call `applyContentRect`
once, or write the rect again; a changed rect is followed by itself.
+### `RectAnchors` — world content that follows its parent
+
+World content has no flexbox, but it often wants to stay at an edge or the centre of its parent,
+or stretch with it. `RectAnchors` pins an entity — placed by its `Transform`, sized by its
+`ContentRect` — to its parent's rectangle:
+
+- **Stretch**: pin both edges of an axis and the entity's size follows the parent.
+- **Pin to an edge**, or **centre with an offset**, on each axis independently.
+- Margins are in layout units, or a fraction of the parent's size (the `isAbs…` flags per margin).
+- With no parent `ContentRect`, the entity aligns to the **screen**, which is centred on the
+ world origin.
+
+`alignMode` says when it aligns: `ONCE`, `ON_RESIZE` (the default: when enabled, when its own
+settings change, and whenever the screen changes) or `ALWAYS` (every frame). Parents are
+aligned before the children that depend on their size, in the editor's edit mode as well as in
+play, so a scene shows laid out as it will run.
+
+```typescript
+import { RectAnchors, AnchorFlag } from 'esengine';
+
+// Stretch across the top of the screen, 40 units from the edges.
+world.insert(banner, RectAnchors, {
+ alignFlags: AnchorFlag.TOP | AnchorFlag.LEFT | AnchorFlag.RIGHT,
+ top: 0, left: 40, right: 40,
+});
+```
+
+### `UIPages` — pages that exist only while wanted
+
+A screen with many pages does not need all of them in the world at once. `UIPages` keeps each
+page as a prefab and builds it the first time it is opened:
+
+```typescript
+import { UIPages } from 'esengine';
+
+const pages = new UIPages(world, assets);
+pages.register('shop', { prefab: 'assets/ui/shop.esprefab', parent: canvas, onClose: 'destroy' });
+
+const shop = await pages.open('shop'); // builds on first open; callers asking at once share one build
+shop.find('buyButton'); // a node by name, inside this page
+pages.close('shop');
+```
+
+- **`onClose`**: `'keep'` (default) switches the page off, so the next open is instant;
+ `'destroy'` takes its contents and assets out and the next open builds again.
+- **`parent`** adds the page as a new root under an entity. **`mount`** is an entity already in
+ the scene: the page is built under it, so it keeps the mount's place in the draw order.
+- `pages.preload(id)` fetches the prefab ahead of time; `pages.onBuilt(fn)` is where to wire a
+ page when it is built.
+- Pages can also come from [virtual prefab instances](/docs/world/prefabs/#virtual-instances):
+ `registerDeferred(entity)` and `registerDeferredAll(root?)` register them, named after the instance root.
+
### Subtree opacity and pointer gating
`UINode` carries two fields that resolve **hierarchically**, in the same pass that already
@@ -228,6 +280,11 @@ const content = spawnUIEntity({ world, parent: viewport, node: { width: px(400),
world.insert(viewport, UIScroll, { vertical: true }); // content defaults to the first child
```
+`Elastic` is opt-in per area (`Clamped` is the default). A drag past an end gets stiffer the
+further out it goes, letting go returns the content, and a flick that reaches an end bounces off it.
+The gesture model behind it, `ScrollMotion` (with `ScrollContainer.dragTo` and `getOverscroll`), is
+exported, so anything else — a world-space node scrolled by touch — can scroll the same way.
+
The component is what a **scene** can say. Scrolling used to be reachable only by building
the `ScrollView` widget in code, so a scroll area placed in the editor described all its
parts — the clipped box, the oversized child — without the one fact that it scrolled.
diff --git a/docs/astro/src/content/docs/ui/widgets.mdx b/docs/astro/src/content/docs/ui/widgets.mdx
index 874fb3961..5e3cba512 100644
--- a/docs/astro/src/content/docs/ui/widgets.mdx
+++ b/docs/astro/src/content/docs/ui/widgets.mdx
@@ -336,7 +336,7 @@ events.on(field, 'change', () => { /* value edited */ });
events.on(field, 'submit', () => save(world.get(field, TextInput).value)); // Enter
```
-The component carries three fields the factory doesn't take — the ones a field
+The component carries four fields the factory doesn't take — the ones a field
authored in a scene needs to stop looking generic:
| Field | Default | Description |
@@ -344,6 +344,7 @@ authored in a scene needs to stop looking generic:
| `font` | `0` | A font asset **this project ships** (`.ttf` / `.otf`), the same slot [`Text.font`](/docs/ui/text/#custom-fonts) uses. Set, it wins over `fontFamily` — so a field on a panel drawn in the game's typeface is drawn in it too, rather than in Arial. |
| `textAlign` | `Left` | Where the value sits in the field: `Left` / `Center` / `Right`. A single line holds the alignment **while the value fits**; past that the field scrolls to follow the caret, exactly as a left-aligned one always has. Multiline aligns per line. |
| `renderMode` | `Auto` | Glyph pipeline for the field text — mirrors `Text.renderMode`. |
+| `inputFilter` | `None` | Which characters the field accepts, whether typed or pasted — the rest are taken out of the value itself, so what is on screen and what a script reads are the same. `TextInputFilter.Digits` keeps `0-9`; `Decimal` keeps `0-9`, a point and a minus sign; `Phone` keeps `0-9` and `+ * # -`. |
**A skinned field keeps its skin.** The field draws over the entity's own
`UIVisual`, and it only manages that visual when it is a **plain fill** —
@@ -361,6 +362,10 @@ const field = spawnUIEntity({
world.insert(field, TextInput, { placeholder: 'Name', font: gameFont, textAlign: TextAlign.Center });
```
+A field does not need a `UINode`: `TextInput` also works on an entity with a
+[`ContentRect`](/docs/ui/overview/#contentrect--a-rectangle-for-world-content), so a text field can stand
+in the world.
+
Click (or Tab to) the field to focus it; **Escape** blurs, **Enter** fires
`submit` on single-line fields. A value longer than the box **clips to it and scrolls
horizontally** so the caret stays in view as you type.
diff --git a/docs/astro/src/content/docs/world/prefabs.mdx b/docs/astro/src/content/docs/world/prefabs.mdx
index 6f89d348a..256bca6b4 100644
--- a/docs/astro/src/content/docs/world/prefabs.mdx
+++ b/docs/astro/src/content/docs/world/prefabs.mdx
@@ -95,6 +95,24 @@ removals in red, with structural changes flagged as destructive.
affected instance and offers a **Repair** — saving the scene persists the cleaned-up state.
</Aside>
+### Virtual instances
+
+A screen made of many pages does not need every page's entities in a running scene. Mark a
+prefab instance **Virtual** (the toggle in the prefab bar of Details, or the Outliner's context
+menu) and the editor still shows and edits it whole, but a running scene makes only its root and
+builds the rest when the instance is opened. Use [`UIPages`](/docs/ui/overview/) to open it:
+`registerDeferred(entity)` registers a virtual instance as a page named after its root.
+
+![The prefab bar at the top of Details with the Edit, Select, Apply, Revert and Virtual buttons](@/assets/guides/en/prefab-virtual-toggle.png)
+
+![The Outliner's context menu on a prefab instance, with Make Virtual (load on demand)](@/assets/guides/en/outliner-prefab-menu.png)
+
+- An instance that adds, removes or re-parents parts is made whole, not virtual.
+- Adding `?expand-virtual` to the page address makes every virtual instance whole at boot, for a
+ test harness that expects every node (an instance marked as another layout of the same page is
+ left out, as the layouts would stand side by side).
+- `deferredEntities` and `deferredRecord` are exported for a game that keeps two layouts this way.
+
## Spawn a prefab
`instantiate` loads the prefab and spawns it. It's async and returns the spawned
diff --git a/docs/astro/src/content/docs/world/tilemaps.mdx b/docs/astro/src/content/docs/world/tilemaps.mdx
index 7ca16a879..133355c0b 100644
--- a/docs/astro/src/content/docs/world/tilemaps.mdx
+++ b/docs/astro/src/content/docs/world/tilemaps.mdx
@@ -230,7 +230,7 @@ tilemap.removeChunk(layer, chunkX, chunkY); // a chunk the player has walked
A chunk is 16 by 16 tiles. A layer's tile rows run **down** from its origin, as in Tiled, so tile row `ty` lies at world y `-ty * tileHeight`: a chunk whose world
square spans `[y, y + 288)` for 18-pixel tiles is chunk row `-(floor(y / 288)) - 1`. `removeChunk` takes the tiles out and the drawn mesh with them, so a layer that
-follows a walker holds the chunks near it and not every one it has held. Streaming a 2D world through `ProceduralChunks` (see [Streaming](/world/streaming/)) with
+follows a walker holds the chunks near it and not every one it has held. Streaming a 2D world through `ProceduralChunks` (see [Streaming](/docs/world/streaming/)) with
`plane: 'xy'` can use either one layer and `removeChunk`, or a small layer entity per chunk that it despawns on release.
## Terrain autotiling
diff --git a/docs/astro/src/content/docs/zh-cn/assets/models.mdx b/docs/astro/src/content/docs/zh-cn/assets/models.mdx
index e1da609c8..7514c1029 100644
--- a/docs/astro/src/content/docs/zh-cn/assets/models.mdx
+++ b/docs/astro/src/content/docs/zh-cn/assets/models.mdx
@@ -180,6 +180,8 @@ chart,每片投影到自己的平面,再按**同一个**世界-纹素比打包
金属度与粗糙度即使等于引擎自己的默认值也会写出来:glTF 把两个系数都默认成 1(完全粗糙的
金属),而 shader 把金属度默认成 0 —— 省略它们的产物会描述出一个源文件没有说过的表面。
+材质里写的贴图如果项目里没有这个文件(模型旁边找不到),就不会绑上它:模型照常导入并给出警告,而不是留下一个每次使用都加载失败的引用。
+
材质还会把这次 draw 的混合、深度和剔除重述一遍 —— 因为材质会**替换**它们,
这样一个被要求自我遮挡的模型,在有了材质之后仍然自我遮挡。
diff --git a/docs/astro/src/content/docs/zh-cn/assets/overview.mdx b/docs/astro/src/content/docs/zh-cn/assets/overview.mdx
index 5ddb8c3ab..fa5584484 100644
--- a/docs/astro/src/content/docs/zh-cn/assets/overview.mdx
+++ b/docs/astro/src/content/docs/zh-cn/assets/overview.mdx
@@ -242,11 +242,15 @@ const freed = trimTextureCache(); // 立即丢弃所有可逐出纹理
### 为 GPU 丢失保留的内存
图形上下文丢失时(驱动重置、手机浏览器回收 GPU),引擎会在游戏持有的句柄背后重建每张纹理和每个
-缓冲。大多数内容从它的来处回来——资产重新加载、文字页按字形重绘、骨骼图集页重新解码。没有这种
+缓冲。大多数内容从它的来处回来——资产重新加载、文字页按字形重绘、骨骼图集页重新解码、地形的图层纹理从文件重新读取并打包、页面图集重新填充。没有这种
来处的内容(运行时构建的网格、加载时拼合的瓦片集)会保留一份 CPU 副本,它占你的内存,却不出现在
任何 GPU 数字里。`stats.retainedBytes` 就是这份副本;引擎自身约 28 KB。副本超过
`RuntimeConfig.retainedBudget`(默认 **16 MB**,构建配置里的 `retainedBudget`,或
`setRetainedBudget(bytes)`;0 表示从不告警)时会告警一次。
+引擎能再生成的内容不会被保留两份:带纹理图层的地形不持有它们的 CPU 副本。
+
+恢复是设备的一次事务,网页游戏会回到丢失之前的画面。引擎等待纹理期间,被设备拒绝的帧从空开始、什么也不收集,
+所以暂存区不会不断增长;恢复后的 WebGL 上下文会先重新获得扩展,设备再探测自己的能力,所以 HDR 场景不会回来就是黑的。
引擎放不回来的是**你的游戏自己画的**内容:渲染纹理是 GPU 存储,设备重建后交还给你的是空的。
`onDeviceRestored` 告诉你什么时候该重画,`RenderTexture.contentLost` 告诉你哪一张需要重画——
diff --git a/docs/astro/src/content/docs/zh-cn/editor/cocos-import.mdx b/docs/astro/src/content/docs/zh-cn/editor/cocos-import.mdx
new file mode 100644
index 000000000..e2da18fd8
--- /dev/null
+++ b/docs/astro/src/content/docs/zh-cn/editor/cocos-import.mdx
@@ -0,0 +1,91 @@
+---
+title: 导入 Cocos Creator 项目
+description: "在编辑器里打开 Cocos Creator 3.x 项目、转换带过来什么、重新导入如何保留你的修改,以及运行项目脚本的 cc 兼容层。"
+---
+
+import { Aside } from '@astrojs/starlight/components';
+
+编辑器可以把一个 **Cocos Creator 3.x** 项目整个带过来:它的场景、预制体、脚本和资源会变成一个
+Estella 项目,你可以在这里继续编辑。Cocos 文件夹只会被读取,不会被修改。
+
+## 打开 Cocos 项目
+
+在**打开项目**里选择一个 Cocos Creator 文件夹。编辑器通过其 `package.json` 里的 Creator 版本识别它,
+并询问是否把它转换成旁边的新项目 `<名字>-estella`,然后打开那个项目。再次打开同一个 Cocos 文件夹
+会直接打开已转换的项目,而不会转换两次。
+
+转换会显示进度:当前所处阶段和完成程度,以进度条覆盖在窗口上。转换跑在独立线程里,窗口不会卡住。
+
+- **图片、字体和 spine 文件是链接而不是复制。** 它们以硬链接放进转换后的项目(只有跨盘才复制),
+ 数 GB 的美术目录既不会被复制,也不会存两份。项目只读这些文件,从不往里写。
+- **项目像游戏一样启动。** 它直接打开 Cocos 的启动场景,使用 Cocos 的设计尺寸;只定义全局变量的脚本
+ (游戏配置)先于场景点名的脚本运行。场景按 uuid 引用的编辑器内置资源(例如默认的进度条图片)
+ 从你安装的 Creator 里读取。
+- **没能带过来的组件会列出来。** 首次转换后会有一条消息,按使用量从多到少列出没有对应物的组件。
+ 它们的数据保留在实体上,但不会有任何逻辑运行。
+- **Cocos 项目自己的 effect 会被转换**成 Estella 的着色器和材质,用了它的精灵、网格或粒子保持原来的外观。
+
+## 转换保留了什么
+
+**屏幕适配。** Cocos 的设计适配(适配宽度、适配高度)变成项目相机的缩放模式(固定宽度、固定高度),
+所以按设计单位布局的 UI 在每种屏幕上大小一致。见[屏幕与设计分辨率](/docs/zh-cn/core-concepts/screen/)。
+
+**层。** 节点在 Cocos 里的层(层序号)会成为它的精灵、文本、图形、spine、粒子和网格所在的层,
+相机的剔除掩码就是在这些层之间选择。所以只画某一层的 UI 相机,画出的内容和在 Cocos 里一致。
+
+**UI。** 转换后的 UI 表现与 Cocos 一致:
+
+- UI 层按层级顺序绘制,所以弹窗会盖住下面视图的文字
+ (见[层级顺序层](/docs/zh-cn/graphics/sprites/#层级顺序层))。
+- `Widget` 变成引擎的 [`RectAnchors`](/docs/zh-cn/ui/overview/#rectanchors--跟随父级的世界内容),配合
+ [`ContentRect`](/docs/zh-cn/ui/overview/#contentrect--世界内容的矩形),所以场景在编辑器里就按运行时的
+ 位置排好。钉在屏幕上的根节点存放在引擎在设计框里放置它的位置。Cocos 的 `Layout` 在引擎的两遍锚点对齐之间运行。
+- 没有溢出规则的 Label 不换行,从它的锚点开始排版。
+- `EditBox` 变成引擎的输入框,两个标签折叠进去。
+- 未激活的节点变成 `Disabled` 标签,整个子树跟着一起关。
+- 位图字体的页保持完整尺寸。
+
+**脚本。** 每个脚本的组件类都会声明给编辑器,因此出现在检查器里。脚本打包时容忍 Cocos 容忍的那些缺口
+(缺少的 `cc` 名字、被重新赋值的 `const`、`exports` 之外的包文件、只在预览里用到的 import)。两个脚本写了
+同一个 `@ccclass` 名字时会被区分开:第二个得到自己的组件名(`Name_2`,按路径顺序),转换器在入口旁写明
+是哪个脚本,打包器把新名字写进那个脚本的装饰器。运行时只有当它读过的文件变了,脚本包才会重新构建。
+
+## 重新导入而不丢失你的修改
+
+在由 Cocos Creator 转换来的项目里执行**重新导入 Cocos 项目**。Cocos 一侧改动过的场景和预制体会被带过来,
+新增的会被加入;你在这里编辑过的文档保持原样,并计入结果,例如“新增 3,更新 2,5 个因你改过而保留”。
+唯一的例外是被编辑过的文档里的 `Cocos.Widget` 组件,它们会变成 `RectAnchors`(字段相同),
+这样由旧版导入器转换的项目也能保留对齐。
+
+转换后的项目会记录导入器的修订号;编辑器打开由更旧导入器写出的项目时,会重新转换一次。
+
+在不是由 Cocos 转换来的项目里执行该命令,只会提示这一点,不会改动任何东西。
+
+## `cc` 兼容层
+
+Cocos 脚本之所以能继续工作,是因为项目脚本构建时 `cc` 被解析到引擎的 Cocos 层(`esengine/cocos`)。
+那里的 `Node` 就是实体,`Component` 子类就是 Estella 组件。Cocos 中没有对应物的部分不做模拟:`cc` 模块里
+这一层没有提供的部分是一个可以被读取、调用、构造的占位,并只提示一次它缺失,而不是 `undefined`。
+转换后项目的每个脚本各自加载,所以某个模块抛错不会阻止其他脚本注册。
+
+已覆盖的内容:
+
+| 方面 | 提供的能力 |
+|---|---|
+| 场景与 `director` | `director.loadScene` 通过引擎的场景管理器运行项目场景(常驻根是 `SceneOwner.persistent`)。场景的组件在帧更新之前的同一阶段启动。`director` 有调度器并触发帧事件,而且是脚本可以打补丁的类。节点的脚本在它加入已激活的父级或被打开时就加载并启用,帧与帧之间创建的节点会加入运行中的世界。 |
+| 节点与组件 | `setSiblingIndex` 通过引擎的实体顺序重排。`getComponent` 可按它派生自的基类或 `cc.` 名字查找组件。`Component.EventHandler`、`Node.getParent`、`Camera.screenPointToRay` 都有。设计分辨率在脚本运行前就已知。 |
+| 加载资源 | `resources.load` 按路径给出图片、精灵帧和音频,并按路径末尾找到图片的 `spriteFrame` 和 `texture`。目录加载会略过这一层加载不了的东西,而不是失败。`loadAny` 接受 uuid。加载的资源以文件名命名并统计持有者。`assetManager` 有下载器、工厂和 `AssetManager.Cache`。 |
+| 网格与材质 | `MeshRenderer` 是引擎网格渲染器的视图:`getSharedMaterial`、`getMaterialInstance`(每个渲染器一个实例,只创建一次)、`material`、`setMaterial`。`Material.setProperty` / `getProperty` 直接写穿到引擎材质(颜色 0..255 变成 0..1);`mainColor`、`albedo`、`baseColor`、`color` 写的是渲染器的色调。还有 `ModelRenderer`、`UIMeshRenderer` 和 `cc.geometry`(`AABB`、`Ray`、`Plane` 以及盒、射线、平面的相交测试)。 |
+| 工具 | `js`(类名与查找、`isChildClassOf`、`mixin`、`addon`、属性定义器)、`ccenum`、`NodePool`(处理组件会收到 `unuse` 和 `reuse`)、`cc.profiler`(`showStats`、`hideStats`)。 |
+| UI 组件 | Widget、Layout、Button、Toggle(Toggle 属于其父级持有的容器;给 `isChecked` 赋值会关掉同组的其他项)、ProgressBar、ScrollView、Label、Sprite、EditBox 等。精灵、标签和图形接受脚本发出的重建请求。 |
+
+<Aside type="note">
+ 两个可点击的东西在同一深度和层上重叠时,点击交给层级位置上后绘制的那个,所以从对象池取出、
+ 加到面板下的节点不会抢走本该给覆盖它的东西的点击。
+</Aside>
+
+## 另请参阅
+
+- [预制体](/docs/zh-cn/world/prefabs/) —— 虚拟实例,让包含很多页面的界面保持轻量。
+- [UI 总览](/docs/zh-cn/ui/overview/) —— `ContentRect`、`RectAnchors` 和 `UIPages`。
+- [屏幕与设计分辨率](/docs/zh-cn/core-concepts/screen/)
diff --git a/docs/astro/src/content/docs/zh-cn/editor/overview.mdx b/docs/astro/src/content/docs/zh-cn/editor/overview.mdx
index 5a026413a..44fc2b9cd 100644
--- a/docs/astro/src/content/docs/zh-cn/editor/overview.mdx
+++ b/docs/astro/src/content/docs/zh-cn/editor/overview.mdx
@@ -46,7 +46,7 @@ Estella 编辑器是一个桌面应用(Electron + React),带 UE5 风格的**可
- **World Outliner**(右) — 场景的实体层级。
- **Details**(右) — 当前选中项的检视器。
- **内容浏览器**、**输出日志**和**性能分析器**(底部标签)。其他面板 —— 序列器、瓦片调色板 —— 在需要时打开:从“面板”菜单,或由拥有它的模式打开。
-- **状态栏** — 内容抽屉开关、编辑模式、场景是否已保存、已加载的模块、FPS、实体数、内存、图形后端和引擎版本。
+- **状态栏** — 内容抽屉开关、编辑模式、场景是否已保存、已加载的模块、FPS、实体数、内存、图形后端和引擎版本。每个读数都保持单行;窗口太窄时,状态栏会先去掉较长的消息和最不重要的读数,而不是换行。
面板可停靠——拖动标签即可重排、拆分或浮动,布局会自动保存。你也能用 **Ctrl / ⌘ + Space** 从任
何地方把内容浏览器唤成上滑浮层(*内容抽屉*)。
diff --git a/docs/astro/src/content/docs/zh-cn/editor/play.mdx b/docs/astro/src/content/docs/zh-cn/editor/play.mdx
index 5343764a4..8844a0e60 100644
--- a/docs/astro/src/content/docs/zh-cn/editor/play.mdx
+++ b/docs/astro/src/content/docs/zh-cn/editor/play.mdx
@@ -23,9 +23,9 @@ description: "在隔离 realm 里于编辑器内运行游戏、运行模式选
## 运行中移动实体
-选中的实体会在运行画面上被描边。打开画面上方的**检视**,指针就归编辑器而不是游戏:点击选中
+打开画面上方的**检视**(或按 **F8**),选中的实体会在运行画面上被描边,指针也归编辑器而不是游戏:点击选中
指针下的东西,然后用变换工具移动、旋转、缩放它——检视开启时工具栏会出现在画面旁边,和编辑时
-一样认 **W / E / R**。默认关闭——点不动的游戏不算游戏。
+一样认 **W / E / R**。默认关闭——点不动的游戏不算游戏。检视关闭时,运行画面上不会画任何选中标记;新的选中只会短暂地标出它的位置。
这些问题全部由运行中的世界回答——实体画在哪、指针下是谁、拖拽落到哪——用的是游戏自己的
相机做投影,所以移动后的位置就是游戏接下来会画的位置。和任何运行期修改一样,它到停止为止。
@@ -50,6 +50,9 @@ description: "在隔离 realm 里于编辑器内运行游戏、运行模式选
重新构建,并查看连接和重载错误。关闭浮层或设置后预览继续运行;停止、切换项目或关闭编辑器
会使链接失效。每次会话生成新的访问令牌,不提供公网穿透。
+手机上的页面和 Play 一样可以连接任意服务器,所以登录局域网游戏服务器的游戏在手机上同样能用。
+正式发布的 Web 导出则更严格:只会连接**项目设置 → 允许连接的服务器**里列出的服务器。
+
保存场景或资源后会重新构建并刷新手机;脚本修改复用现有的结构探测和系统热替换,兼容时保留
运行中的世界。结构变化时重载页面并显示原因。构建失败时保留上一份完整预览。
预览构建跳过 AOT 与资源压缩;原生和小游戏的设备部署继续使用对应平台工具。
diff --git a/docs/astro/src/content/docs/zh-cn/editor/scenes.mdx b/docs/astro/src/content/docs/zh-cn/editor/scenes.mdx
index 4072a44e3..2ad7729d8 100644
--- a/docs/astro/src/content/docs/zh-cn/editor/scenes.mdx
+++ b/docs/astro/src/content/docs/zh-cn/editor/scenes.mdx
@@ -25,6 +25,9 @@ Outliner 是场景的层级。你可以:
拿掉——精灵、骨架、瓦片图、粒子、灯光一概如此——而不改动游戏真正加载的场景。锁定则仍然可见、可选中,
只是不再有把手:视口不会拾取它,变换 Gizmo 也不会为它出现。
- 从选择**创建预制体**,再把实例拖回场景。
+- 右键预制体实例可用**编辑预制体**、**应用到预制体**、**还原为预制体**、**创建变体**、**解包预制体**,以及
+ **设为虚拟(按需加载)** / **设为完整(随场景加载)**。虚拟实例在这里完整显示、照常编辑,但运行中的场景只生成它的根节点——
+ 见[虚拟实例](/docs/zh-cn/world/prefabs/#虚拟实例)。
## Details 面板
@@ -36,6 +39,8 @@ Details 是选中项的检视器。它列出实体上的每个组件及其字段
每个组件都是一个**可折叠区**,而且面板会记住你折了哪些——跨重新选择*以及*编辑器重启——所以检视器
会保持你离开时的整洁。很少动的"周边"(某个控件的 `Focusable` 与 `ThemeStyle` 标签)默认折叠。
+预制体实例的 Details 顶部预制体条上有同样的**虚拟**开关。
+
当可视化控件比一排裸数字更清楚时,Details 会显示一个**专用控件**——大多用于 UI 节点:
- 用于绝对定位 `UINode` 的**锚点**控件:一个可点击的 **3×3 网格**,对应九个点锚
diff --git a/docs/astro/src/content/docs/zh-cn/editor/settings.mdx b/docs/astro/src/content/docs/zh-cn/editor/settings.mdx
index f627b941a..9335e3318 100644
--- a/docs/astro/src/content/docs/zh-cn/editor/settings.mdx
+++ b/docs/astro/src/content/docs/zh-cn/editor/settings.mdx
@@ -13,20 +13,43 @@ description: "编辑器偏好,以及写入 project.esproject 的项目级设置
你自己的密钥、模型和接口。
- **项目** — 存进 `project.esproject`,谁打开这个项目都共用:
- **游戏** — **显示**(项目设计分辨率:播种新 Canvas,驱动任意场景的设备预览;项目级的**屏幕方向**:
- 所有导出目标都遵循它,留空则从设计分辨率的宽高比推导;以及**相机适配**:主相机如何在无 UI Canvas
- 的情况下按设计分辨率缩放,`无`=关闭)、**UI**(控件**主题**,深色 / 浅色,与逐角色的**主题颜色**
+ 所有导出目标都遵循它,留空则从设计分辨率的宽高比推导;**相机适配**:主相机如何在无 UI Canvas
+ 的情况下按设计分辨率缩放,`无`=关闭;以及**渲染分辨率**:场景按屏幕大小、设计分辨率还是它的整数倍
+ 绘制,再缩放到屏幕)、**UI**(控件**主题**,深色 / 浅色,与逐角色的**主题颜色**
覆盖,在编辑器、Play 和所有导出里一致生效——见 [UI 控件——主题](/docs/zh-cn/ui/widgets/#主题))、
- **音频**和 **Spine**。
+ **音频**、**Spine** 和**运行时**(引擎的调参,见下文)。
- **渲染** — 最多三十二个命名排序层,填充检视器里的层下拉,以及其中哪些参与 Y 轴排序。
- 名字只是建议,不是上限:渲染组件的 `layer` 照样接受名单以外的数字。画质档位和项目环境也在这里。
+ 名字只是建议,不是上限:渲染组件的 `layer` 照样接受名单以外的数字。画质档位和项目环境也在这里,还有关于交付的选择:后台编译着色器、在启动页后面预热,以及只绘制会变化的帧
+ (见[画质档位](/docs/zh-cn/performance/quality-levels/#着色器编译与按需渲染))。
- **物理** — 启用、重力、十六个碰撞层名字和一个 16×16 碰撞矩阵,以及解算器调参(固定时间步、
子步、接触 Hz/阻尼/推出速度、允许睡眠、连续碰撞)。见 [物理](/docs/zh-cn/gameplay/physics/)。
- **构建与模块** — 每目标的打包元数据(微信 AppID、桌面应用 id / 产品名、启动页、成就)和项目包含的
- 引擎模块。
+ 引擎模块,以及 Web 构建的**允许连接的服务器**——页面可以连接的服务器(`wss://play.example.com`)。不写时,
+ 页面的内容安全策略只允许连接它自己的来源。
+ - **配置表** — 可选的 **Luban**(策划在 Excel 里配表,编辑器生成游戏读取的 JSON 和 TypeScript)和
+ **Protobuf**(用 `.proto` 文件描述的消息会生成 TypeScript 类型和紧凑的二进制编解码)工具。两者默认关闭:
+ 关闭时编辑器不检测也不下载任何东西;打开后会检查工具是否已安装(下载前会先问你),并保持生成的代码是最新的。
设一次就不再动的设置——屏幕预设、解算器调参、主题的各个颜色、模块开关、你自己的 AI 提供方接口——收在
页面的**高级**折叠下,这样页面主体就是大家真正会碰的东西。
+## 运行时
+
+**项目 → 游戏 → 运行时**放的是引擎自己的调参,以前只能从代码里改。项目文件只保存与引擎默认值不同的部分,
+写在 `features.runtime` 下;每次构建都带上同一块内容,Play 在第一个资源加载之前就应用它。编辑视口沿用引擎自己的值。
+
+![项目设置的游戏页「运行时」一节:场景切换、帧限制、缓存预算和文字四个分组](@/assets/guides/zh/settings-runtime.png)
+
+用得最少的几项收在该页的**高级**折叠里:**每帧最多固定步数**、**加载超时**、**失败重试冷却**、**设备丢失备份**和**文字画布大小**。
+
+| 分组 | 设置 |
+|---|---|
+| **场景切换** | 切换场景时,调用没有指定则使用的淡入淡出**时长**(默认 0.3 秒)和**颜色**。 |
+| **帧限制** | **单帧最长步进**(0.25 秒):耗时更长的一帧(标签页在后台、卡顿)只让游戏前进这么多,而不是真实经过的时间。**每帧最多固定步数**(8):一帧内定步长更新(物理)追赶步数的上限;超过后模拟变慢,而不是越追越卡。 |
+| **资源加载** | **加载超时**(30 秒):单个资源加载多久还没完成就判为失败;**失败重试冷却**(5 秒):失败后隔多久才再次尝试同一个资源。 |
+| **缓存预算** | 为暂时没人用的纹理保留的显存(**纹理缓存**,64 MiB)、为当前没在播放的音频保留的解码结果(**音频缓存**,32 MiB)、以及图形设备为 GPU 丢失后恢复而保留的 CPU 端副本(**设备丢失备份**,16 MiB,超过就警告)。前两项设为 0 即关闭。 |
+| **文字** | 文字栅格化所用的**文字画布大小**(512),以及没有指定字体族的 Text 所用的**默认字体族**。 |
+
## 编辑器语言
编辑器内置 **English** 和 **简体中文**,首次启动跟随系统语言。在 **设置 → 编辑器 → 常规 → 外观 → 语言** 切换——
diff --git a/docs/astro/src/content/docs/zh-cn/editor/shortcuts.mdx b/docs/astro/src/content/docs/zh-cn/editor/shortcuts.mdx
index 588c3fcd7..4aa2d978c 100644
--- a/docs/astro/src/content/docs/zh-cn/editor/shortcuts.mdx
+++ b/docs/astro/src/content/docs/zh-cn/editor/shortcuts.mdx
@@ -24,10 +24,14 @@ import { Aside } from '@astrojs/starlight/components';
| 聚焦选中 | `F` |
| 运行 · 停止 | `F5` · `Esc` |
| 暂停/继续 · 重启 | `F6` · `shift + F5` |
+| 运行时检视(开关) | `F8` |
| 最大化 / 还原视口 | `F11` |
+| 打包项目… | `mod + shift + B` |
+| 快速跳转… | `mod + P` |
| 命令面板 | `mod + shift + P` |
| 内容抽屉 | `Ctrl + Space` |
| 项目设置 | `mod + ,` |
+| 放大 / 缩小 / 重置界面 | `mod + =` / `mod + -` / `mod + 0` |
**命令面板**(`mod + shift + P`)对每一条可运行命令做模糊搜索——不用翻菜单,直达任何操作的最快方式。
diff --git a/docs/astro/src/content/docs/zh-cn/gameplay/physics-3d.mdx b/docs/astro/src/content/docs/zh-cn/gameplay/physics-3d.mdx
index ec132554b..19fff54c9 100644
--- a/docs/astro/src/content/docs/zh-cn/gameplay/physics-3d.mdx
+++ b/docs/astro/src/content/docs/zh-cn/gameplay/physics-3d.mdx
@@ -39,6 +39,9 @@ cmds.spawn()
| `SphereCollider3D` | `radius`。 |
| `CapsuleCollider3D` | 一个直立胶囊:`halfHeight` 是圆柱段的一半,两端各扣一个 `radius` 的半球,所以总高是 `2 * (halfHeight + radius)`。 |
+这三种碰撞体都还有可选的 `center`:形状相对实体原点的位置,单位为世界单位(默认 `{ 0, 0, 0 }`)。
+刚体仍位于实体处,所以动态刚体绕自己的原点转动,偏离中心的形状会绕着它甩动。
+
<Aside>
尺寸按**世界单位**书写,以米为单位抵达求解器,用的是 2D 世界同一个 `pixelsPerUnit`
(默认 100)。一个按米调好的求解器在角色高 180 单位时完全不是它自己,所以这次换算
diff --git a/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx b/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx
index c05a1670e..5274991d3 100644
--- a/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx
+++ b/docs/astro/src/content/docs/zh-cn/graphics/materials.mdx
@@ -1,6 +1,6 @@
---
title: 材质与着色器
-description: 自定义材质完整指南——用 #pragma param 反射 uniform 编写 GLSL、Material API,以及把材质应用到渲染器。
+description: "自定义材质完整指南——用 #pragma param 反射 uniform 编写 GLSL、Material API,以及把材质应用到渲染器。"
---
import { Aside } from '@astrojs/starlight/components';
@@ -156,6 +156,9 @@ std140 uniform 块,于是 CPU 能按名字设置、并安全地送到 GPU。一
| `v_texCoord` | `vec2` | 纹理 UV。 |
| `v_worldPos` | `highp vec2` | 世界坐标(**仅 Lit 域**)。 |
+在带第二套 uv 的**网格**上(`MESH_LIGHTMAP` 变体),顶点阶段还会给片元阶段一个 `v_texCoord1`(`vec2`)——
+原样的第二套 uv,与引擎由它推出的光照图坐标并列。不是烘焙的材质可以用它做遮罩或溶解贴图。
+
精灵纹理是 `u_textures[0]`(声明 `uniform sampler2D u_textures[8];`——单元 0–7 归批处理;
纹理*参数*自动绑定在其上方)。
@@ -194,6 +197,9 @@ std140 uniform 块,于是 CPU 能按名字设置、并安全地送到 GPU。一
`#pragma switch` 选择编译期烘焙进材质的静态着色器排列(通过 `compileShader` 的 `features` 参数)。
+`#if` 和 `#elif` 的条件可以使用 `defined`、`!`、`&&`、`||` 和括号,在着色器的 WGSL 孪生版里与在 GLSL 里按同样方式解析,
+所以用引擎自带顶点阶段的受光材质、或受光的 2D 着色器,在 WebGPU 上与在 WebGL2 上一样能画出来。
+
## 用代码创建与应用
**只编译一次**着色器(不要每帧),做一个材质,然后把渲染器指向它:
diff --git a/docs/astro/src/content/docs/zh-cn/graphics/post-processing.mdx b/docs/astro/src/content/docs/zh-cn/graphics/post-processing.mdx
index d24291f4c..52f60920b 100644
--- a/docs/astro/src/content/docs/zh-cn/graphics/post-processing.mdx
+++ b/docs/astro/src/content/docs/zh-cn/graphics/post-processing.mdx
@@ -77,8 +77,10 @@ Estella 通过 ping-pong 帧缓冲运行全屏后处理。加一个 `PostProcess
### 雨、潮湿的地面与水坑
`rain` 是由两部分组成的暴雨。**落下的雨**是三层在屏幕上向下滚动的细斜线,每层站在自己的距离上:比该层更近的表面会挡住
-雨丝,更远的表面则被雨丝盖住,天空算作无限远。**潮湿的地面**由深度缓冲找出——朝上、平得能存水的表面——并按 `wetness`
-压暗,因为孔隙里的水吞掉了干燥表面会散射的光。落在上面的雨滴留下**涟漪**(扩散并消退的圆环)和**水花**(落在非水面上的
+雨丝,更远的表面则被雨丝盖住,天空算作无限远。**潮湿的表面**是雨落到的一切,按 `wetness`
+压暗,因为孔隙里的水吞掉了干燥表面会散射的光。朝向天空的地面压暗到满值,背向天空的表面稍弱一些(最低到满值的 0.6),
+取自表面自己的法线(G-buffer 里有就用它,例如树叶),否则取自深度缓冲,所以暴雨中的山坡和植物会和旁边的平地一起变暗,
+而不是浅浅地突出来。需要**平地**——朝上、平得能存水的表面——的是积水和落在上面的雨滴,它们留下**涟漪**(扩散并消退的圆环)和**水花**(落在非水面上的
小而快的冠状溅起),它们排布在世界里的网格上,所以相机移动时仍留在地面上。涟漪需要雨滴:`intensity` 为 0 时地面潮湿但静止。
**水坑**是积水:`puddles` 是多少平地被水覆盖,`puddleScale` 是水坑多大(世界长度)。水坑更暗,涟漪更密更清晰,没有水花。
diff --git a/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdx b/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdx
index b966a9c77..1cd65b641 100644
--- a/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdx
+++ b/docs/astro/src/content/docs/zh-cn/graphics/sprites.mdx
@@ -217,6 +217,12 @@ world.applyEntityOrder([other, another, card]);
只对需要它的玩法层开启 Y 排序。
</Aside>
+### 层级顺序层
+
+`Renderer.setTreeSortLayers(mask)` 指定一些层(位 0–31),其上的精灵、文本与图形按层级顺序叠放——
+父节点先于子节点、靠前兄弟的整棵子树先于靠后兄弟的——而不是按着色器与深度排序。
+适合需要"上面的面板盖住下面面板的文字"的场景。
+
### 屋顶与树冠遮挡淡出
盖在地面上的屋顶、树冠会挡住走进去的人。给遮挡的精灵加 `CoverFade`,给必须看得见的对象(玩家)加 `CoverFadeTarget`:目标站在精灵所覆盖的地面上时,精灵在 `fadeTime` 内淡到自身 alpha 的 `opacity` 倍,离开后淡回。
diff --git a/docs/astro/src/content/docs/zh-cn/performance/profiling.mdx b/docs/astro/src/content/docs/zh-cn/performance/profiling.mdx
index 1496553e9..1ccd73d94 100644
--- a/docs/astro/src/content/docs/zh-cn/performance/profiling.mdx
+++ b/docs/astro/src/content/docs/zh-cn/performance/profiling.mdx
@@ -511,7 +511,9 @@ for (const s of app.subsystems.getStatuses()) {
桌面编辑器的剖析 UI 建立在同一套表面上:**Profiler 面板**显示实时帧时间曲线以及
逐阶段、逐系统的分解(点击某帧可检查它),视口里还有一个小的性能浮层用来一眼看
-FPS。对游戏内构建,上面的 `statsPlugin` 就是对应物。
+FPS。点击成本树或系统列表的列标题,可按名称或按耗时排序,再点一次反向;所选的排序会被记住。
+按耗时排序时,两个系统一超过对方行就会换位,在实时窗口里几乎每隔几帧就发生一次;想盯住某个系统时,
+请按名称排序。系统列表会列出十二个系统。对游戏内构建,上面的 `statsPlugin` 就是对应物。
## 最佳实践
diff --git a/docs/astro/src/content/docs/zh-cn/performance/quality-levels.mdx b/docs/astro/src/content/docs/zh-cn/performance/quality-levels.mdx
index 72e7a05f7..b55ae3dc3 100644
--- a/docs/astro/src/content/docs/zh-cn/performance/quality-levels.mdx
+++ b/docs/astro/src/content/docs/zh-cn/performance/quality-levels.mdx
@@ -27,7 +27,7 @@ import { Aside } from '@astrojs/starlight/components';
| 分组 | 设置 |
|---|---|
-| 渲染 | 渲染比例、最小渲染比例、MSAA、细节距离 |
+| 渲染 | 渲染比例、最小渲染比例、抗锯齿方式(MSAA 或时间性)、MSAA、深度预通道、细节距离 |
| 阴影 | 图集尺寸、单元尺寸、级联数、距离 |
| 反射与粒子 | 平面反射的比例、最大尺寸和每秒更新次数,粒子上限 |
| 后处理 | 总开关,以及在这个档位运行的每个效果的勾选框 |
@@ -35,6 +35,8 @@ import { Aside } from '@astrojs/starlight/components';
每个档位从引擎自己的值起步,**只有你改过的才会保存**到 `project.esproject` 的
`features.rendering.quality.profiles.<档位>` 下。引擎以后改进的默认值会传给从没碰过它的项目;改回该档位默认值的行也不再算差异。
+**抗锯齿方式**可选 MSAA 或时间性(TAA)。时间性按 1 个采样绘制,由 TAA 通道用之前的帧来平滑:1080p 下便宜得多,画面略软,需要相机上有后处理体积;选它时 MSAA 一行会隐藏。**深度预通道**把不透明场景画两遍,先只画深度,让每个像素只为最前面的表面着色一次。表面大量重叠(树林、成片植被)且 GPU 对光栅化出的像素立即着色时划算;对把着色推迟到分块末尾的 GPU,等于几何多付一遍。低档默认关,中、高档默认开。预通道和颜色通道在 WebGL2 与 WebGPU 上都把顶点位置声明为 invariant,所以表面的颜色总能通过与自己深度的等深测试,Metal 上也一样;Mac 上开着预通道时地形出现暗色三角形,只需更新到新的构建。
+
<Aside type="note">
一行的"默认值"是它正显示的那个档位的默认值,所以同一个数字在低档可能是改动,在中档却是默认。
</Aside>
@@ -58,6 +60,29 @@ import { Aside } from '@astrojs/starlight/components';
模式为自动时显示。每行写一个档位和设备必须满足的条件:**型号包含**、**GPU 包含**、**内存上限**、**核心上限**,全部成立才算。
第一条匹配的规则决定档位。没有任何条件的规则会匹配所有设备,所以必须至少有一个条件。
+## 着色器编译与按需渲染
+
+同一页还有两组设置,管的是游戏*如何交付*,而不是它跑在哪个档位。它们与画质档位无关,模式为**关闭**时同样生效,保存在 `features.rendering.quality` 下。
+
+![项目设置的渲染页:着色器编译、按需渲染、省电和抗锯齿四个分组](@/assets/guides/zh/settings-shader-compilation.png)
+
+**着色器编译**
+
+| 设置 | 作用 |
+|---|---|
+| **后台编译着色器**(`asyncShaderCompile`) | 浏览器还在编译着色器的绘制会先跳过,游戏立刻打开,画面随着色器就绪逐步补全。关闭时,第一次用到某个着色器的绘制会等它编完:每一帧都完整,但首次访问可能卡住数秒。需要 `KHR_parallel_shader_compile`,没有该扩展时仍按原方式编译。 |
+| **在启动页后面预热**(`prewarmShaders`) | 在启动页后面把第一个场景画到没有着色器在编译为止,再打开成完整画面。开启后台编译后才显示。 |
+| **预热超时** | 启动页最多等多久(秒,默认 30);超时后不管有没有编完都直接打开。开启预热后才显示。 |
+
+**按需渲染**
+
+| 设置 | 作用 |
+|---|---|
+| **只绘制会变化的帧**(`renderOnDemand`) | 静止的画面只花游戏逻辑的开销。有人请求绘制、玩家有操作、画面尺寸变化、实体被创建或销毁、或仍有着色器在编译时,才会画一帧。 |
+| **变化后继续绘制的帧数**(`renderOnDemandTail`) | 最后一次绘制原因之后继续画的帧数,让淡出或收尾动作能走完。默认 30。 |
+
+引擎看不到脚本自己改了什么(颜色、动画):用 `RenderDemand.request()` 请求画一帧,或用 `RenderDemand.hold()`(返回释放它的函数)声明某样东西在自己运动,否则这类变化要等别的原因唤醒画面才会画出来。所以这个开关默认关闭。
+
## 省电与降温
手机上玩得久,就是发热和耗电,而这两样都花在画面这一帧上。打开 **电量低或设备发烫时降低开销**(`QualityConfig.power`)后,引擎每隔几秒看一眼设备:处于省电状态时,降低帧率上限并给画质档位设一个上限,设备恢复后再放回。关闭(默认)时不监测设备,什么都不变。
diff --git a/docs/astro/src/content/docs/zh-cn/publishing/android-ios.mdx b/docs/astro/src/content/docs/zh-cn/publishing/android-ios.mdx
index 8f66b0696..280779cf8 100644
--- a/docs/astro/src/content/docs/zh-cn/publishing/android-ios.mdx
+++ b/docs/astro/src/content/docs/zh-cn/publishing/android-ios.mdx
@@ -173,6 +173,7 @@ Android 的下限是 29,因为引擎的字体路径调用 `AFontMatcher_create`,
| 音频 | 原生混音器([miniaudio](https://miniaud.io/))—— CoreAudio / AAudio |
| 文本输入 | 平台**软键盘**就是输入框的编辑面 |
| 网络 | 系统网络栈(`NSURLSession` / `HttpURLConnection`) |
+| 地形与流式世界 | 在原生运行时上运行。地形的图层纹理和其他纹理一样以字节送到设备(设备上没有可供拷贝的 wasm 堆);分块世界的生成器使用自己的取消句柄,因为 QuickJS 没有 `AbortController` |
| 压缩纹理 | KTX2 转码到设备支持的格式(ASTC → ETC2 → BC),含 mip 链 |
| 生命周期 | `onShow` / `onHide` 与系统内存警告都能到达应用 |
diff --git a/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx b/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx
index 73c699ea2..2e2593512 100644
--- a/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx
+++ b/docs/astro/src/content/docs/zh-cn/publishing/overview.mdx
@@ -76,7 +76,7 @@ import { Aside, Steps } from '@astrojs/starlight/components';
资产优化为 **Auto** 时,试玩导出先应用 PNG 的 **Max Size**(含启用的 `playable` 覆盖)及各 WAV 资源的码率。实际包体超出网络上限、项目交付预算和 **3 MiB 回归目标** 的最小值时,依次尝试无损 WebP、允许压缩音频的较低码率(128、96 kbps),再尝试 WebP 质量 90 和 80。每个候选按实际 HTML、ZIP 测量;交付体积与 HTML 上限均达标即停止。纹理保持烘焙后的尺寸和透明度;nearest 过滤像素画、位图字体页和数据纹理仅使用无损编码;含 gamma/色彩配置、动画或 16 位采样的 PNG 保持原格式,以保留渲染语义。图片及音频的禁用压缩设置生效,**Skip** 保留源文件载荷。
-导出自检报告和编辑器结果展示优化前后体积及每个资源选用的编码。3 MiB 是内部回归目标,不是平台官方上限;达到质量下限仍未满足目标会明确报告,实际平台 HTML 超限仍使导出失败。WebP 使用随产品提供的 ffmpeg 编码器;不可用时保留图片并给出警告。源文件和导入设置不被修改。发布前请检查图片、音频质量,并在官方容器验证交付包;体积达标不等同平台验收。
+导出自检报告和编辑器结果展示优化前后体积及每个资源选用的编码。3 MiB 是内部回归目标,不是平台官方上限;达到质量下限仍未满足目标会明确报告,`index.html` 超过平台的未压缩 HTML 上限时,文件照常写出,并给出带体积的警告——瘦身还是照发由你决定,不会让构建失败。当任何编码器都压不小的部分(字体等文件)本身就已超过目标时,会跳过优化搜索,直接按原样构建并报告体积和构成;每个阶段都会报告进度。WebP 使用随产品提供的 ffmpeg 编码器;不可用时保留图片并给出警告。源文件和导入设置不被修改。发布前请检查图片、音频质量,并在官方容器验证交付包;体积达标不等同平台验收。
各家平台收的都是同一个单文件 HTML,但在三件事上不一致:体积上限、`<head>` 里必须放什么、
以及用哪个函数把玩家送去商店。在**打包项目**对话框里选平台(就在 Playable 目标自己的设置里),
diff --git a/docs/astro/src/content/docs/zh-cn/ui/controllers.mdx b/docs/astro/src/content/docs/zh-cn/ui/controllers.mdx
index ee827752e..27a79290e 100644
--- a/docs/astro/src/content/docs/zh-cn/ui/controllers.mdx
+++ b/docs/astro/src/content/docs/zh-cn/ui/controllers.mdx
@@ -81,6 +81,8 @@ world.insert(card, UIGear, {
**取值**——数字、颜色(`{r,g,b,a}`)、向量(`{x,y,z}`)在有 `tween` 时插值;字符串和布尔总是瞬切。
被绑定的元素在该字段上归控制器所有:每次切页,绑定就把该页的值写上去。
+一帧里没有控制器、绑定或父级变化、世界结构不变、也没有补间在跑时,绑定不花任何开销,
+所以挂着成千上万个绑定的静止界面依然很轻。
<Aside type="note">
绑定在 **编辑期也生效**——应用它的系统不受 play 门控。所以在编辑器里切换控制器的页,
diff --git a/docs/astro/src/content/docs/zh-cn/ui/interaction.mdx b/docs/astro/src/content/docs/zh-cn/ui/interaction.mdx
index 65af8d72b..e391c9b1c 100644
--- a/docs/astro/src/content/docs/zh-cn/ui/interaction.mdx
+++ b/docs/astro/src/content/docs/zh-cn/ui/interaction.mdx
@@ -40,6 +40,9 @@ const onTiles = defineSystem([Query(Interactable, UIInteraction)], (q) => {
});
```
+两个可点节点在同一深度、同一层上重叠时,命中归**画在后面**(更靠上)的那个——由它在层级里的位置决定,而不是创建顺序。
+所以从对象池取出、挂到面板下的节点,不会抢走本该给覆盖它的节点的点按。
+
只要有任一 UI 节点被命中,`input.isPointerOverUI()` 即为 `true`——这是防止
点按钮同时触发世界点击的标准防线。
diff --git a/docs/astro/src/content/docs/zh-cn/ui/overview.mdx b/docs/astro/src/content/docs/zh-cn/ui/overview.mdx
index 459c71b76..7b1270024 100644
--- a/docs/astro/src/content/docs/zh-cn/ui/overview.mdx
+++ b/docs/astro/src/content/docs/zh-cn/ui/overview.mdx
@@ -165,6 +165,53 @@ addStartupSystem(buildPauseMenu);
同时有 `UINode` 和 `ContentRect` 的实体,裁剪仍用布局的盒子。给已有矩形的实体再加
`Sprite` 或 `Text` 时:调用一次 `applyContentRect`,或者把矩形再写一遍;矩形变化时它们会自己跟随。
+### `RectAnchors` —— 跟随父级的世界内容
+
+世界内容没有 flexbox,但常常要贴着父级的某条边、居中,或随父级拉伸。`RectAnchors` 把一个
+用 `Transform` 摆放、用 `ContentRect` 定大小的实体钉到父级矩形上:
+
+- **拉伸**:同一轴的两条边都钉住,实体尺寸就跟随父级。
+- 每个轴可以独立地**钉到一条边**,或**居中并带偏移**。
+- 边距可以是布局单位,也可以是父级尺寸的比例(每个边距各有一个 `isAbs…` 开关)。
+- 父级没有 `ContentRect` 时,对齐到**屏幕**,屏幕以世界原点为中心。
+
+`alignMode` 决定何时对齐:`ONCE`、`ON_RESIZE`(默认:启用时、自身设置变化时、屏幕变化时)
+或 `ALWAYS`(每帧)。父级总是先于依赖其尺寸的子级对齐,编辑器的编辑模式下和运行时一样,
+所以场景在编辑器里看到的就是运行时的布局。
+
+```typescript
+import { RectAnchors, AnchorFlag } from 'esengine';
+
+// 横贯屏幕顶部,距左右边缘各 40 单位。
+world.insert(banner, RectAnchors, {
+ alignFlags: AnchorFlag.TOP | AnchorFlag.LEFT | AnchorFlag.RIGHT,
+ top: 0, left: 40, right: 40,
+});
+```
+
+### `UIPages` —— 用到才存在的页面
+
+一个有很多页面的界面不需要把它们同时放进世界。`UIPages` 把每个页面存成预制体,第一次打开时才构建:
+
+```typescript
+import { UIPages } from 'esengine';
+
+const pages = new UIPages(world, assets);
+pages.register('shop', { prefab: 'assets/ui/shop.esprefab', parent: canvas, onClose: 'destroy' });
+
+const shop = await pages.open('shop'); // 首次打开时构建;同时打开的调用共享一次构建
+shop.find('buyButton'); // 按名字在本页内找节点
+pages.close('shop');
+```
+
+- **`onClose`**:`'keep'`(默认)只是把页面关掉,下次打开是即时的;`'destroy'` 把它的内容连同资源
+ 一起移除,下次打开重新构建。
+- **`parent`** 把页面作为新根加到某个实体下;**`mount`** 是场景里已有的实体:页面构建在它下面,
+ 因此保持挂载点在绘制顺序中的位置。
+- `pages.preload(id)` 提前拉取预制体;`pages.onBuilt(fn)` 是页面构建后接线的地方。
+- 页面也可以来自[虚拟预制体实例](/docs/zh-cn/world/prefabs/#虚拟实例):用 `registerDeferred(entity)`
+ 和 `registerDeferredAll(root?)` 注册,页面名取实例根的名字。
+
### 子树透明度与指针门
`UINode` 上有两个**沿层级解析**的字段,与已有的 `display` 在同一趟里完成:
@@ -207,6 +254,10 @@ const content = spawnUIEntity({ world, parent: viewport, node: { width: px(400),
world.insert(viewport, UIScroll, { vertical: true }); // content 缺省取第一个子节点
```
+`Elastic` 按区域自行开启(默认是 `Clamped`)。拖过一端时越拉越紧,松手后内容回弹,甩动撞到一端会被弹回。
+它背后的手势模型 `ScrollMotion`(配合 `ScrollContainer.dragTo` 与 `getOverscroll`)已导出,
+所以别的东西——比如靠触摸滚动的世界空间节点——也能用同样的方式滚动。
+
这个组件补的是**场景能说出口的话**。以前滚动只能靠在代码里构造 `ScrollView` widget,所以在
编辑器里摆出来的滚动区能描述自己的每个零件——被裁剪的盒子、超长的子节点——唯独说不出「它会滚」
这件事。`UIScroll` 就是这件事,现在 widget 和场景驱动的是同一个容器。
diff --git a/docs/astro/src/content/docs/zh-cn/ui/widgets.mdx b/docs/astro/src/content/docs/zh-cn/ui/widgets.mdx
index 3581bd7ae..fc923c117 100644
--- a/docs/astro/src/content/docs/zh-cn/ui/widgets.mdx
+++ b/docs/astro/src/content/docs/zh-cn/ui/widgets.mdx
@@ -321,13 +321,14 @@ events.on(field, 'change', () => { /* value edited */ });
events.on(field, 'submit', () => save(world.get(field, TextInput).value)); // Enter
```
-组件上还有三个字段是工厂不收的——恰是场景里创作的输入框想摆脱"千框一面"所需的:
+组件上还有四个字段是工厂不收的——恰是场景里创作的输入框想摆脱"千框一面"所需的:
| 字段 | 默认 | 说明 |
|---|---|---|
| `font` | `0` | **本项目自带**的字体资源(`.ttf` / `.otf`),与 [`Text.font`](/docs/zh-cn/ui/text/#自定义字体) 是同一个槽位。设了它就压过 `fontFamily`——于是画在游戏自有字体面板上的输入框也用那套字,而不是 Arial。 |
| `textAlign` | `Left` | 值在框内的位置:`Left` / `Center` / `Right`。单行**在放得下时**保持该对齐;放不下之后改为跟随光标横向滚动,与一向左对齐时的行为一致。多行按行对齐。 |
| `renderMode` | `Auto` | 框内文本的字形管线——与 `Text.renderMode` 对应。 |
+| `inputFilter` | `None` | 框接受哪些字符,键入或粘贴都一样——其余字符直接从值里剔除,所以屏幕上看到的和脚本读到的一致。`TextInputFilter.Digits` 只留 `0-9`;`Decimal` 留 `0-9`、小数点和负号;`Phone` 留 `0-9` 与 `+ * # -`。 |
**已换皮的输入框会保住它的皮。** 输入框画在实体自己的 `UIVisual` 上,而它**只**在
这个 visual 是**纯色填充**时才去管它——`backgroundColor` 是给没人换皮的框兜底用的。
@@ -344,6 +345,8 @@ const field = spawnUIEntity({
world.insert(field, TextInput, { placeholder: 'Name', font: gameFont, textAlign: TextAlign.Center });
```
+输入框不需要 `UINode`:`TextInput` 也能放在带 [`ContentRect`](/docs/zh-cn/ui/overview/#contentrect--世界内容的矩形) 的实体上,于是输入框可以直接立在世界里。
+
点击(或 Tab 到)输入框即聚焦;**Escape** 失焦,单行框 **Enter** 触发 `submit`。
超出盒宽的内容**裁剪到盒内并横向滚动**,输入时光标始终可见。
diff --git a/docs/astro/src/content/docs/zh-cn/world/prefabs.mdx b/docs/astro/src/content/docs/zh-cn/world/prefabs.mdx
index 2f382771e..5ac9b970e 100644
--- a/docs/astro/src/content/docs/zh-cn/world/prefabs.mdx
+++ b/docs/astro/src/content/docs/zh-cn/world/prefabs.mdx
@@ -78,6 +78,22 @@ Prefab Mode 暂不支持:就地编辑**嵌套**预制体,或基不是扁平的
toast)。检视器会标出受影响的实例并提供 **Repair**——保存场景即把清理后的状态写入文件。
</Aside>
+### 虚拟实例
+
+一个由很多页面组成的界面,运行中的场景不需要每个页面的实体都在。把预制体实例标记为**虚拟**
+(Details 预制体栏里的开关,或 Outliner 右键菜单),编辑器里仍然完整显示、完整编辑,但运行中的
+场景只创建它的根,其余部分在实例被打开时才构建。用 [`UIPages`](/docs/zh-cn/ui/overview/) 来打开它:
+`registerDeferred(entity)` 把一个虚拟实例注册为页面,页面名取实例根的名字。
+
+![Details 顶部的预制体栏,有编辑、选择、应用、还原和虚拟几个按钮](@/assets/guides/zh/prefab-virtual-toggle.png)
+
+![Outliner 里预制体实例的右键菜单,含「设为虚拟(按需加载)」](@/assets/guides/zh/outliner-prefab-menu.png)
+
+- 增、删或改父级了部件的实例会被变成完整实例,不再是虚拟的。
+- 页面地址里加 `?expand-virtual` 会在启动时把所有虚拟实例变完整,供要求每个节点都在的测试环境使用
+ (标记为同一页面另一种布局的实例除外,因为各布局会并排出现)。
+- `deferredEntities` 和 `deferredRecord` 已导出,给用这种方式保存两套布局的游戏使用。
+
## 生成一个预制体
`instantiate` 加载预制体并生成它。它是异步的,并返回生成的树——`root` 是新的根实体:
diff --git a/docs/astro/src/data/componentDocs.ts b/docs/astro/src/data/componentDocs.ts
index 82048d689..d1a977a39 100644
--- a/docs/astro/src/data/componentDocs.ts
+++ b/docs/astro/src/data/componentDocs.ts
@@ -87,7 +87,7 @@ export const COMPONENT_DOCS: Record<string, ComponentDoc> = {
SwayPusher: { category: 'graphics', summary: 'A body the plants of a sprite-sway material lean away from as it walks through them: the eight nearest the camera are told to the shader.', doc: 'graphics/materials', anchor: 'built-in-shader-templates', anchorZh: '内置着色器模板' },
FogOfWar: { category: 'graphics', summary: 'Names the world rectangle a 2D fog of war covers: ground no SightViewer has seen is dark, ground seen and left is remembered, ground in view is clear.', doc: 'graphics/sprites', anchor: 'fog-of-war', anchorZh: '战争迷雾' },
SightViewer: { category: 'graphics', summary: 'An eye: sprites with a SightTarget are seen while some viewer has a clear line to them past the ShadowCaster2D walls.', doc: 'graphics/sprites', anchor: 'what-the-player-can-see', anchorZh: '玩家能看见什么' },
- SightTarget: { category: 'graphics', summary: 'Hides the sprite while no SightViewer has a clear line to it, for what is not lit and so is not hidden by the walls' shadows.', doc: 'graphics/sprites', anchor: 'what-the-player-can-see', anchorZh: '玩家能看见什么' },
+ SightTarget: { category: 'graphics', summary: 'Hides the sprite while no SightViewer has a clear line to it, for what is not lit and so is not hidden by the shadows of walls.', doc: 'graphics/sprites', anchor: 'what-the-player-can-see', anchorZh: '玩家能看见什么' },
CoverFade: { category: 'graphics', summary: 'A roof or a tree crown that thins out while a CoverFadeTarget stands under it, so the player is never hidden by what they walked into.', doc: 'graphics/sprites', anchor: 'fading-a-roof-or-a-crown-over-the-player', anchorZh: '屋顶与树冠遮挡淡出' },
CoverFadeTarget: { category: 'graphics', summary: 'Marks what a CoverFade keeps visible — the player, and anything else that must not be hidden by a roof or a crown.', doc: 'graphics/sprites', anchor: 'fading-a-roof-or-a-crown-over-the-player', anchorZh: '屋顶与树冠遮挡淡出' },
RainUpright: { category: 'graphics', summary: 'Marks a sprite that stands on the ground (a character, a trunk), so the 2D rain draws no rings, splashes or wet darkening over it.', doc: 'graphics/sprites', anchor: 'keeping-the-ground-under-a-roof-dry', anchorZh: '让屋顶下的地面保持干燥' },