getMenuButtonBoundingClientRect
Synchronously returns the bounds of the host’s top-right menu button to the game. Use the top-left corner of the game view as the origin. All coordinates and dimensions are in physical pixels (px).
Declaration
java
MenuButtonBoundingClientRect getMenuButtonBoundingClientRect();MenuButtonBoundingClientRect
global.sud.op.runtime.client.model.MenuButtonBoundingClientRect
| Field | Type | Description |
|---|---|---|
width | int | Width in pixels |
height | int | Height in pixels |
top | int | Top in pixels |
right | int | Right in pixels |
bottom | int | Bottom in pixels |
left | int | Left in pixels |
After layout, use the button bounds relative to the game view. If measuring both views with getLocationOnScreen(), subtract the game view’s x-coordinate from the button’s left and right edges and its y-coordinate from the top and bottom edges. Keep the measured width and height.
For example, if the button’s screen bounds are (774, 120, 1032, 216) in (left, top, right, bottom) order and the game view starts at (24, 60), return (750, 60, 1008, 156). The button is 258 × 96 px.
