cocos_drag_preview
Simulate mouse drag interactions in Cocos Creator to test UI elements like sliders or draggable cards by specifying start and end coordinates with adjustable motion steps.
Instructions
Drag the mouse from (from_x, from_y) to (to_x, to_y).
steps is the number of intermediate move events — bump it if
Cocos isn't picking up the drag (some handlers need minimum
motion per frame). 5 is enough for a typical slider or card move.
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": {
"url": "<url>",
"from_x": "<from_x>",
"from_y": "<from_y>",
"to_x": "<to_x>",
"to_y": "<to_y>"
},
"name": "cocos_drag_preview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| from_x | Yes | ||
| from_y | Yes | ||
| to_x | Yes | ||
| to_y | Yes | ||
| steps | No | ||
| button | No | left | |
| wait_ms | No | ||
| viewport_width | No | ||
| viewport_height | No | ||
| timeout_ms | No |