From 117148816c43b4f658f2e7f686e36b85fbe938d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 18 Aug 2026 13:39:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=92=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20UI=20=E7=BC=96=E8=BE=91=E5=99=A8=E7=BB=84=E4=BB=B6=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E4=B8=8E=E8=AE=BE=E8=AE=A1=E8=A7=84=E5=88=99=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补充粒度要求、 响应式布局 Anchor 配置说明, 优化坐标系描述。 --- .../src-tauri/src/ui_editor/commands/binding.rs | 11 ++++++----- .../src-tauri/src/ui_editor/commands/recognition.rs | 6 ++++-- .../src/ui_editor/commands/ui_design_suggestion.rs | 4 +++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/binding.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/binding.rs index 15627288e..ee243dbb8 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/binding.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/binding.rs @@ -19,11 +19,12 @@ pub const ASSET_BATCH_SIZE: usize = 5; const SYSTEM_PROMPT: &str = r#" 你是游戏 UI 组件绑定器。你会看到全部 UI 参考图、可编辑节点说明,以及本批独立素材的真实像素。 -只对视觉上确实需要改变组件的节点返回 changes;未返回的节点必须保持不变。每个 change 的 components 是该节点完整的新渲染栈,空数组表示明确清空。数组顺序从底到顶渲染。 - -只能返回当前正式 Component 契约中的 Image 和 Text。对每个 Component,直接完整返回其全部参数;不要省略、默认化或由你之外的代码补齐参数。Image 的 target_graphic 必须是本批输入的素材 id;无法唯一匹配时返回 null,并把状态设为 NeedReview,说明中文原因。Text 写可见文本;动态数值也使用 Text。纯结构节点可以返回空数组并标为 Passed。 - -不得返回坐标、Transform、children、节点名称、权限或任何未定义字段。面向用户的 reason 使用中文。 +* 只对视觉上确实需要改变组件的节点返回 changes; +* 每个 change 的 components 是该节点完整的新渲染栈,空数组表示明确清空。数组顺序从底到顶渲染。 +* 对每个 Component,直接完整返回其全部参数. +* 有任何困难或者不确定把状态设为 NeedReview,说明中文原因。 +* 纯结构节点可以返回空数组并标为 Passed。 +* 面向用户的 reason 使用中文。 "#; #[derive(Clone, Debug, Deserialize, JsonSchema)] diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs index 39a73f9d4..af6f2769a 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/recognition.rs @@ -33,14 +33,16 @@ const SYSTEM_PROMPT: &str = r#" 识别规则: * 只识别 UI,不识别场景人物、地形、建筑、光影和背景装饰。 -* 不创建没有独立功能的微小装饰Node。 * 无法确定类型、层级、关系时,在 UnSure 中写明原因。 * 返回的 trees 必须与输入图片一一对应,每张输入图片只能有一棵树,不能合并多张图片的树。 每棵树的 src_ui_design_image_id 必须等于对应输入图片标注的 id。 -* 每棵树必须使用自己的输入图片原始像素坐标系(0,0 is left top)输出 +* 每棵树必须使用自己的输入图片原始像素坐标系(0,0 as left top)输出 global_pos_x_px、global_pos_y_px、width_px、height_px; +* 为了响应式布局, 我们提供了类似godot的Anchor参数, 可以使用语义化的预设或者可custom的直接操作min max, 请准确地根据父子布局的关系使用 * 面向用户的字段如名称描述等请用中文 * 由于每个截图未必是完整的, 可能是局部的, 每棵树描述清楚每个截图上UI的层次结构即可 * 不同树的共用框架/层次/...请使用使用相同的名称描述. 不同状态/变体名称使用相同的前缀, 用后缀区别 +* 粒度要求: 尽可能细致, 最小单元举例: 进度条的底槽、填充和外框; slider的底槽, dragger等 + "#; #[derive(Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)] diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs index a72be8e28..d8da10676 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/ui_design_suggestion.rs @@ -28,7 +28,9 @@ const SYSTEM_PROMPT: &str = r#" State 表示同一界面的状态变体, Scrolled 表示滚动或分页后的内容, Detail 表示局部详情或补充证据。 -- children:该节点直接包含的子界面图。根节点必须是 Page,子节点不能是 Page;没有子节点时返回空数组。 +- children:该节点直接包含的子界面图。 + +- 根节点必须是 Page,子节点不能是 Page 所有字段都必须出现,禁止省略字段、使用 null 或返回空字符串。每张参考图最多出现一次;id 必须逐字匹配输入图片 id。 以下 UI 设计图中的 metadata 部分信息已确定,请根据已有信息补全语义.