Create Sprite Node
cocos_local_create_sprite_nodeCreates or ensures a sprite node in a Cocos Creator scene by attaching a Sprite component and assigning a specified SpriteFrame asset, optionally saving the scene.
Instructions
Ensure a scene node exists, attach a Sprite component, resolve a SpriteFrame asset, assign it, and optionally save the scene.
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": {
"projectRoot": "<projectRoot>",
"sprite": "<sprite>"
},
"name": "cocos_local_create_sprite_node"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | ||
| sprite | Yes | ||
| openScene | No | ||
| saveScene | No | ||
| scenePath | No | assets/scenes/Main.scene | |
| timeoutMs | No | ||
| projectRoot | Yes | ||
| openSceneDelayMs | No |