Skip to content

Optimization of monitor user experience #2818

@go-wyvern

Description

@go-wyvern

monitor 用户体验优化:

背景(Why/Context):

  • Scratch 项目在转换链路中会把 Scratch 的 monitor 信息转换为 SPX Monitor 的 JSON 配置,供运行时/编辑器使用(字段包含 target/val/label/mode/x/y/visible 等)。
  • SPX Monitor 的 target 为空表示 Stage/Game;非空时为 sprite 名称。
  • val 使用字符串标识符(例如 getVar:score),运行时通过求值逻辑获取当前值。
  • 已知限制与对比见:goplus/sb2xbp#126、goplus/sb2xbp#127(以及 sb2xbp 的 doc/monitor.md):
    • 支持变量监视(getVar:变量名);列表监视通常以字符串形式显示
    • 不支持传感器类监视(x/y/heading/timer 等)与 slider 交互
    • 转换器目前只转换 mode=1,会过滤掉 mode=2/3
    • Scratch 与 SPX 坐标系原点不同,转换需要做坐标映射
  • 因此 Builder 侧需要把 monitor 的配置过程结构化(target 选择、属性列表选择等),减少手填字符串导致的错误,并与 LS/SPX 能力对齐。

讨论结论(基于 goplus/sb2xbp#126 的讨论):

  • 使用空 label 的 monitor 作为 Scratch large mode 的转换对象
  • slider/list 暂不支持,后续再看
  • Builder 放开目前 target 必须为空字符串的限制,以支持 monitor 使用 sprite 上的数据

因此代办事项包括:

  1. monitor 支持 target,支持 select 选择 对象(stage/sprite name)
  2. 对象属性支持 select:需 ls 配合支持
  3. spx 游戏引擎支持属性大小写兼容
  4. 优化空 label 的 monitor 样式(包括编辑态与运行时)

子 issue:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions