cocos_make_event_handler
Create event handler dictionaries for Cocos Creator components like scroll views, toggles, sliders, and edit boxes to bind component events without writing TypeScript code.
Instructions
Build a cc.EventHandler dict for component event bindings.
Use with: cocos_add_scroll_view(scroll_events=[...]), cocos_add_toggle(check_events=[...]), cocos_add_slider(slide_events=[...]), cocos_add_editbox(editing_return=[...]).
Same pattern as cocos_make_click_event but for non-Button components.
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>",
"target_node_id": "<target_node_id>",
"component_name": "<component_name>",
"handler": "<handler>"
},
"name": "cocos_make_event_handler"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| target_node_id | Yes | ||
| component_name | Yes | ||
| handler | Yes | ||
| custom_data | No |