Add comment
add_commentAdd a comment to a Scratch sprite or stage to explain code blocks or note ideas. Attach to a specific block for context, or place freely on the canvas.
Instructions
Add a workspace comment to a target. With no blockId the comment floats free on the canvas; pass a blockId (a key in the target's blocks map — see get_target_json) to attach it to that block, which also sets the block's comment back-reference so the editor anchors it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Canvas X position. | |
| y | No | Canvas Y position. | |
| text | Yes | The comment text. | |
| width | No | Box width in pixels. | |
| height | No | Box height in pixels. | |
| target | Yes | Sprite name, or "Stage". | |
| blockId | No | Block id to attach to. Omit for a free-floating comment. | |
| minimized | No | Whether the comment is collapsed to its title bar. |