cocos_add_hud_bar
Add a horizontal HUD bar to display game information like score and level. Configure text labels and spacers, then pin it to the top or bottom of the screen for endless-runner style games.
Instructions
Build a horizontal HUD bar pinned to the top (or bottom).
items is a list of:
{"kind": "label", "text": str, "size_preset": str, "color_preset": str, "width": int, "align": str}— text cell{"kind": "spacer", "width": int}— blank gap
Default is a Score label + spacer + Lv label, good for endless-
runner style games. side: "top" (default) or "bottom".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| parent_node_id | Yes | ||
| items | No | ||
| height | No | ||
| side | No | top |