getMenuButtonBoundingClientRect(params: Object)

Requires:
MiniKit≥2.3.0@ray-js/ray≥0.3.23
Platforms:
iOSAndroid
import { getMenuButtonBoundingClientRect } from '@ray-js/ray';

// Promise usage
try {
  const res = await getMenuButtonBoundingClientRect();
  console.log(res);
} catch (err) {
  console.log(err.errorMsg);
}

Description

Get the layout and position of the menu button (the capsule button in the top-right corner). Coordinates use the top-left of the screen as the origin.

Parameters

PropertyTypeRequiredDescription
complete() => voidNoCompletion callback (executed on both success and failure)
success(params: Object) => voidNoCallback on successful API call
fail(params: Object) => voidNoFailure callback
success callback parameters
PropertyTypeDescriptionMiniKit Since
widthnumberWidth, unit: pxv3.2.0
heightnumberHeight, unit: pxv3.2.0
topnumberTop boundary coordinate, unit: pxv3.2.0
rightnumberRight boundary coordinate, unit: pxv3.2.0
bottomnumberBottom boundary coordinate, unit: pxv3.2.0
leftnumberLeft boundary coordinate, unit: pxv3.2.0
fail callback parameters
PropertyTypeDescription
errorMsgstringError message
errorCodestring | numberError code
Error extension

Return Value

None

Examples

import { getMenuButtonBoundingClientRect } from '@ray-js/ray'

getMenuButtonBoundingClientRect({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});