cocos_add_image
Add PNG images to Cocos Creator projects by copying files and generating sprite-frame metadata for game development assets.
Instructions
Copy a PNG into the project and write a complete sprite-frame meta.
Default: assets/textures/. Set as_resource=True to put it under assets/resources/ (needed for runtime loading via resources.load()).
Returns {path, rel_path, main_uuid, sprite_frame_uuid, texture_uuid}.
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": {
"project_path": "<project_path>",
"src_png": "<src_png>"
},
"name": "cocos_add_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| src_png | Yes | ||
| rel_path | No | ||
| as_resource | No |