Last updated October 5, 2026
UI
This API helps align the menu button within the mini game's navigation bar.
TTMinis.game.getMenuButtonBoundingClientRect()
Note: Requires base library version 0.3.0 or later. Lower versions require compatibility handling.
Gets the layout position of the menu button (the capsule button in the top-right corner). Coordinates are measured from the top-left corner of the screen.
Returns
An object containing the layout position information of the menu button, with the following fields:
Field | Type | Description |
|
| The width, in pixels (px) |
|
| The height, in pixels (px) |
|
| The top edge coordinate, in pixels (px) |
|
| The right edge coordinate, in pixels (px) |
|
| The bottom edge coordinate, in pixels (px) |
|
| The left edge coordinate, in pixels (px) |
Example
const res = TTMinis.game.getMenuButtonBoundingClientRect()
console.log(res.width)
console.log(res.height)
console.log(res.top)
console.log(res.right)
console.log(res.bottom)
console.log(res.left)