cocos_add_richtext
Add formatted rich text to Cocos Creator UI nodes using HTML-like tags for bold, italic, color, size, and images, with preset sizing options.
Instructions
Attach cc.RichText. Supports , , <color=#FF0000>, <size=24>, tags.
size_preset ("title"/"heading"/"body"/"caption")
overrides font_size from the project's UI theme and sets
line_height to ~1.25× of it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| node_id | Yes | ||
| text | No | <b>Hello</b> | |
| font_size | No | ||
| max_width | No | ||
| line_height | No | ||
| horizontal_align | No | ||
| size_preset | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |