cocos_add_main_menu
Add a full-screen vertical main menu with background, title, and stacked buttons to Cocos Creator scenes for game navigation and settings access.
Instructions
Build a full-screen vertical main menu: bg + title + stacked buttons.
Buttons use same shape as cocos_add_dialog_modal. Default is
a "Start" (primary) + "Settings" (ghost) pair.
Typical flow::
scene = cocos_create_scene(...) cocos_set_ui_theme(project, theme="dark_game") cocos_add_main_menu(scene, scene["canvas_node_id"], "Flappy Bird", buttons=[{"text": "Start", "variant": "primary", "click_events": [click_evt]}])
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": {
"scene_path": "<scene_path>",
"parent_node_id": "<parent_node_id>",
"title": "<title>"
},
"name": "cocos_add_main_menu"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scene_path | Yes | ||
| parent_node_id | Yes | ||
| title | Yes | ||
| buttons | No | ||
| button_width | No | ||
| button_height | No |