Menu Functions
The menu module supports two display modes:
- Portrait Mode (Navigation Bar): Traditional top navigation bar style, suitable for mobile portrait orientation
- Landscape Mode (Bubble Menu): Floating bubble style menu, suitable for mobile landscape orientation
Show Menu minigameApi.showMenu(options)
Portrait Mode Example (Navigation Bar):
// Initialize with portrait mode
const minigameApi = midas.minigame({
appid: '1460000904',
region: 'us',
menu: {
isLandscapeMode: false // Portrait mode (default)
}
});
// Show portrait menu
minigameApi.showMenu({
gradually: true
});
Landscape Mode Example (Bubble Menu):
// Initialize with landscape mode
const minigameApi = midas.minigame({
appid: '1460000904',
region: 'us',
menu: {
isLandscapeMode: true // Landscape mode (bubble style)
}
});
// Show landscape menu
minigameApi.showMenu({
gradually: true
});
Parameter Description
| Parameter | Type | Required | Description |
|---|---|---|---|
| gradually | boolean | No | Whether to show progressively, default true |
Hide Menu minigameApi.hideMenu(options)
// Hide game menu (works for both portrait and landscape modes)
minigameApi.hideMenu({
gradually: true
});
Parameter Description
| Parameter | Type | Required | Description |
|---|---|---|---|
| gradually | boolean | No | Whether to hide progressively, default true |