cocos_add_layout
Add layout components to Cocos Creator nodes to arrange child elements horizontally, vertically, or in grids with customizable spacing and padding.
Instructions
Attach cc.Layout. layout_type: 0=NONE, 1=HORIZONTAL, 2=VERTICAL, 3=GRID.
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_layout"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| node_id | Yes | ||
| layout_type | No | ||
| spacing_x | No | ||
| spacing_y | No | ||
| padding_top | No | ||
| padding_bottom | No | ||
| padding_left | No | ||
| padding_right | No | ||
| resize_mode | No | ||
| h_direction | No | ||
| v_direction | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |