cocos_add_toggle
Adds a toggle component to Cocos Creator nodes, enabling interactive checkboxes with custom event handlers for game UI development.
Instructions
Attach cc.Toggle. check_events: list from cocos_make_event_handler().
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"scene_path": "<scene_path>",
"node_id": "<node_id>"
},
"name": "cocos_add_toggle"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| node_id | Yes | ||
| is_checked | No | ||
| transition | No | ||
| check_events | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |