Skip to content

KookyCWindow - #328

Open
KookyC wants to merge 3 commits into
Gandi-IDE:mainfrom
KookyC:main
Open

KookyCWindow#328
KookyC wants to merge 3 commits into
Gandi-IDE:mainfrom
KookyC:main

Conversation

@KookyC

@KookyC KookyC commented Aug 3, 2026

Copy link
Copy Markdown

YinWindow 窗口扩展使用文档

📖 简介 | Introduction

YinWindow 是一个用于 Scratch 的窗口与弹窗扩展,允许用户在 Scratch 项目中创建自定义窗口、添加各种组件(文本、按钮、文本框、图像等),以及使用各类弹窗(Alert、Prompt、Ask、进度条等)。

YinWindow is a window and popup extension for Scratch, allowing users to create custom windows, add various components (text, buttons, text boxes, images, etc.), and use various popups (Alert, Prompt, Ask, progress bar, etc.) in Scratch projects.


📦 扩展信息 | Extension Info

项目 详情
扩展 ID YinWindow
版本 1.0.3
合作者 𝓑𝓵𝓾𝓮𝓕𝓮𝓪𝓽𝓱er @ CCW, KookyC @ Gandi

🧩 积木列表 | Blocks List

第一板块:创建窗口 | Section 1: Create Window

积木 说明 Description
创建窗口 [windowId], 标题栏高斯模糊[blur],主体高斯模糊[blur2] 创建一个自定义窗口,可分别控制标题栏和主体的模糊效果 Create a custom window with separate blur controls for title bar and body

参数说明 | Parameters:

  • windowId: 窗口唯一标识符 | Unique window identifier
  • blur: 标题栏是否存在高斯模糊效果 | Whether the title bar has Gaussian blur
  • blur2: 窗口主体是否存在高斯模糊效果 | Whether the window body has Gaussian blur

第二板块:设置 | Section 2: Settings

积木 说明 Description
设置窗口 [windowId] 的图标 [base64] 设置窗口的图标 Set window icon
设置窗口 [windowId] 背景颜色为 [color] 设置窗口背景颜色 Set window background color
设置窗口 [windowId] 高为 [height] 宽为 [width] 调整窗口尺寸 Adjust window size

参数说明 | Parameters:

  • windowId: 窗口唯一标识符 | Unique window identifier
  • base64: Base64 编码的图片数据 | Base64 encoded image data
  • color: 颜色值(支持十六进制、RGB 等) | Color value (hex, RGB, etc.)
  • height / width: 窗口高度/宽度(像素) | Window height/width (pixels)

第三板块:组件 | Section 3: Components

积木 说明 Description
在窗口 [windowId] 中加入文本组件 [textId] 内容为 [content] 位置x [x] y [y] 添加静态文本 Add static text
在窗口 [windowId] 中增加按钮组件 [buttonId] 按钮颜色 [color] 内容 [content] 位置x [x] y [y] 添加可点击按钮 Add clickable button
在窗口 [windowId] 中增加文本框 [textBoxId] 文本框状态 [state] 位置x [x] y [y] 文本初始内容 [initialContent]提示[prompt] 添加单行输入框 Add single-line input box
在窗口 [windowId] 中增加多行文本框 [textAreaId] 状态 [state] 位置x [x] y [y] 宽 [width] 高 [height] 初始内容 [initialContent]提示[prompt] 添加多行输入框 Add multi-line input box
在窗口 [windowId] 中创建TXT多行文本 [txtAreaId] 位置x [x] y [y] 宽 [width] 高 [height] 初始内容[content] 添加代码风格的多行文本(等宽字体,可调整大小) Add code-style multi-line text (monospace, resizable)
在窗口 [windowId] 中增加一个图像 [imageId] [base64] 位置x [x] y [y] 添加图片显示 Add image display

参数说明 | Parameters:

组件通用参数 | Common Parameters:

  • windowId: 窗口唯一标识符 | Unique window identifier
  • x / y: 组件在窗口内的坐标位置(像素) | Component position within window (pixels)

文本/按钮/图像 | Text/Button/Image:

  • textId / buttonId / imageId: 组件唯一标识符 | Unique component identifier
  • content: 显示内容 | Display content
  • color: 按钮背景颜色 | Button background color

文本框 | TextBox:

  • textBoxId: 文本框唯一标识符 | Unique text box identifier
  • state: 状态(enabled 可操作 / disabled 不可操作)| State (enabled / disabled)
  • initialContent: 初始文本内容 | Initial text content
  • prompt: 占位提示文本 | Placeholder prompt text

多行文本框 | TextArea:

  • textAreaId: 多行文本框唯一标识符 | Unique text area identifier
  • state: 状态(enabled / disabled)| State (enabled / disabled)
  • width / height: 文本框宽度/高度(像素)| Text area width/height (pixels)
  • initialContent: 初始文本内容 | Initial text content
  • prompt: 占位提示文本 | Placeholder prompt text

TXT多行文本 | TXT Area:

  • txtAreaId: TXT 文本框唯一标识符 | Unique TXT area identifier
  • width / height: 文本框宽度/高度(像素)| Text area width/height (pixels)
  • content: 初始文本内容(支持 \n 换行)| Initial text content (supports \n line breaks)

第四板块:删除组件 | Section 4: Delete Components

积木 说明 Description
删除文本 [textId] 删除指定的文本组件 Delete specified text component
删除按钮 [buttonId] 删除指定的按钮组件 Delete specified button component
删除图像 [imageId] 删除指定的图像组件 Delete specified image component
删除文本框 [textBoxId] 删除指定的文本框组件 Delete specified text box component
删除多行文本框 [textAreaId] 删除指定的多行文本框组件 Delete specified text area component
删除TXT多行文本 [txtAreaId] 删除指定的 TXT 多行文本组件 Delete specified TXT area component

参数说明 | Parameters:

  • 所有积木只需传入对应的组件 ID | All blocks only require the corresponding component ID

第五板块:弹窗 | Section 5: Popups

积木 说明 Description
创建一个Alert弹窗,内容[textAlert] 显示一个浏览器原生 Alert 弹窗 Display a browser native Alert popup
创建一个提示弹窗,内容[prompt] 显示一个带确定按钮的提示弹窗 Display a prompt popup with a confirm button
创建弹窗并询问[ask] 显示一个带“是/否”按钮的询问弹窗 Display an ask popup with Yes/No buttons
获取询问的返回 获取询问弹窗的返回结果(true/false) Get the result of the ask popup (true/false)
创建进度条弹窗,进度[theNew]% 显示一个进度条弹窗,可更新进度 Display a progress bar popup, can update progress
进度 获取当前进度值 Get current progress value

参数说明 | Parameters:

  • textAlert: Alert 弹窗显示的内容 | Content displayed in Alert popup
  • prompt: 提示弹窗显示的内容 | Content displayed in Prompt popup
  • ask: 询问弹窗显示的问题 | Question displayed in Ask popup
  • theNew: 进度值(0-100)| Progress value (0-100)

第六板块:组件效果 | Section 6: Component Effects

积木 说明 Description
当按钮 [buttonId] 被点击时 检测指定按钮是否被点击(布尔积木,点击后自动重置) Detect if specified button is clicked (Boolean block, auto-resets after click)
获取文本框 [textBoxId] 的内容 获取指定文本框或多行文本框的内容 Get content of specified text box or text area

参数说明 | Parameters:

  • buttonId: 要检测的按钮 ID | Button ID to detect
  • textBoxId: 要获取内容的文本框 ID | Text box ID to get content from

第七板块:辅助工具 | Section 7: Utilities

积木 说明 Description
载入文件并解析为base64 打开文件选择器,返回文件的 Base64 编码 Open file picker, return file's Base64 encoding
RGB格式R[red],G[green],B[blue]转十六进制 将 RGB 颜色值转换为十六进制颜色代码 Convert RGB color values to hex color code

参数说明 | Parameters:

  • red / green / blue: RGB 颜色值(0-255)| RGB color values (0-255)

💡 使用提示 | Usage Tips

  1. 窗口默认位置:窗口创建后默认显示在屏幕左上角附近,可通过拖动标题栏移动位置。
    Default position: Windows appear near the top-left corner of the screen by default; drag the title bar to move.

  2. 组件定位:所有组件的 xy 坐标是相对于窗口内容区域的左上角。
    Component positioning: All component x and y coordinates are relative to the top-left corner of the window content area.

  3. 按钮点击检测当按钮被点击时 积木会在检测到点击后自动重置状态,适合放在循环中持续监听。
    Button click detection: The when button clicked block auto-resets after detection, suitable for use in loops.

  4. 进度条弹窗:创建后可通过再次调用 创建进度条弹窗 并传入新进度值来更新进度。
    Progress bar popup: After creation, call Create progress bar popup again with a new value to update progress.

  5. 文件载入载入文件并解析为base64 积木支持图片文件,返回的 Base64 可直接用于 设置窗口图标添加图像 等积木。
    File loading: The Load file and encode as Base64 block supports image files; the returned Base64 can be used directly in Set window icon or Add image blocks.


🔧 状态菜单 | State Menu

选项 说明 Description
可操作 enabled 文本框可编辑 Text box is editable
不可操作 disabled 文本框不可编辑 Text box is read-only

🖼️ 默认图标 | Default Icon

扩展内置了一个默认窗口图标,你也可以通过 设置窗口图标 积木替换为自定义图标。

The extension includes a default window icon; you can replace it with a custom icon using the Set window icon block.


📌 注意 | Note: 本扩展适用于 Scratch 3.0 及兼容环境。使用前请确保已正确加载扩展文件。
This extension is designed for Scratch 3.0 and compatible environments. Please ensure the extension file is properly loaded before use.

@sylarhcn

sylarhcn commented Aug 5, 2026 via email

Copy link
Copy Markdown
Contributor

@KookyC

KookyC commented Aug 5, 2026

Copy link
Copy Markdown
Author

我已经发送至CCW扩展市场了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants