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).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meta_path | Yes | ||
| top | No | ||
| bottom | No | ||
| left | No | ||
| right | No |