A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
docs: the shown/hidden example named an action that does not exist
yhh6165c0ecf6f7
diff --git a/docs/astro/src/content/docs/guides/events.mdx b/docs/astro/src/content/docs/guides/events.mdxindex e77b0ea3b..57d6eb984 100644--- a/docs/astro/src/content/docs/guides/events.mdx+++ b/docs/astro/src/content/docs/guides/events.mdx@@ -138,12 +138,12 @@ hears its buttons:`shown` and `hidden` are the exception to "a widget emits them": nobody clicked anything, thenode simply arrived on screen or left it — usually because an **ancestor** was shown or hidden,-which is what navigation, tabs and dialogs do. Every node in the subtree is told, so an entrance-animation is a row on the panel that plays it rather than a system that watches for it:+which is what navigation, tabs and dialogs do. Every node in the subtree is told, so "when this+screen appears" is a row on the screen rather than a system that watches for it:-| Event | Action | Target |-|---|---|---|-| `shown` | `tween.play` | *(this entity)* |+```+shown ─▶ fsm.fire(enter) on "MissionPanel" → Hidden ──enter──▶ Entering+```The watching costs nothing until something listens for one of the two, and nothing again on aframe where no UI moved.diff --git a/docs/astro/src/content/docs/zh-cn/guides/events.mdx b/docs/astro/src/content/docs/zh-cn/guides/events.mdxindex 11205e02d..3ca97bc1f 100644--- a/docs/astro/src/content/docs/zh-cn/guides/events.mdx+++ b/docs/astro/src/content/docs/zh-cn/guides/events.mdx@@ -132,11 +132,11 @@ registerAction('game.award', {`shown` 和 `hidden` 是「控件发出的」里的例外:没人点任何东西,是这个节点出现在了屏幕上、或者离开了屏幕——通常因为**某个祖先**被显示或隐藏,也就是导航、页签、弹窗在做的事。子树里的每个节点都会被告知,-所以入场动画是挂在那块面板上的一行,而不是一个每帧去盯着的系统:+所以「这块界面出现的时候」是挂在那块界面上的一行,而不是一个每帧去盯着的系统:-| 事件 | 动作 | 目标 |-|---|---|---|-| `shown` | `tween.play` | *(本实体)* |+```+shown ─▶ fsm.fire(enter) 挂在 "MissionPanel" → Hidden ──enter──▶ Entering+```在没有人监听这两个事件之前,这份「盯着」不花任何代价;有人监听、但这一帧 UI 没动过时,同样不花。