cocos_set_ui_theme
Apply a consistent UI theme to Cocos Creator game elements, ensuring visual harmony across labels, buttons, and sprites using built-in or custom design tokens.
Instructions
Pin a UI theme so every subsequent cocos_add_label /
cocos_add_button / cocos_add_sprite call with
color_preset=… / size_preset=… resolves through the
same design tokens — produces a visually consistent game.
Built-in theme names: dark_game, light_minimal,
neon_arcade, pastel_cozy, corporate. Pass a
custom dict ({color, font_size, spacing, radius}) for
something bespoke — missing preset names fall through to
dark_game defaults so no lookup ever fails.
Preset vocabulary every theme MUST provide: color: primary / secondary / bg / surface / text / text_dim / success / warn / danger / border (10) font_size: title / heading / body / caption (4) spacing: xs / sm / md / lg / xl (5) radius: sm / md / lg / pill (4)
Calling with no args pins dark_game.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| theme | No | ||
| custom | No |