Skip to content

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();

global.sud.op.runtime.client.model.MenuButtonBoundingClientRect

FieldTypeDescription
widthintWidth in pixels
heightintHeight in pixels
topintTop in pixels
rightintRight in pixels
bottomintBottom in pixels
leftintLeft 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.