cocos_set_sprite_frame_border
Define 9-slice borders on sprite-frames to maintain crisp corners when stretching UI elements like buttons and panels in Cocos Creator.
Instructions
Set 9-slice border on an existing sprite-frame meta in pixels.
Required before using a PNG with cc.Sprite type=SLICED (rounded buttons, UI panels, dialog backgrounds — anything that should keep crisp corners while stretching the middle).
Idempotent. The meta must already be sprite-frame type
(run cocos_upgrade_image_meta first if it's still texture-only).
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": {
"meta_path": "<meta_path>"
},
"name": "cocos_set_sprite_frame_border"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meta_path | Yes | ||
| top | No | ||
| bottom | No | ||
| left | No | ||
| right | No |