cocos_set_property
Set literal properties like text, color, or size on Cocos Creator scene objects programmatically without manual editing.
Instructions
Set a literal (non-reference) property on any scene object.
Use this for things like _string, _fontSize, _color, etc.
For node/component references, use cocos_link_property instead.
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>",
"object_id": "<object_id>",
"prop_name": "<prop_name>",
"value": "<value>"
},
"name": "cocos_set_property"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| object_id | Yes | ||
| prop_name | Yes | ||
| value | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |