Skip to main content

setDataToOverlay

Passes positioning or display data to the Maestro overlay.

Overview​

Call setDataToOverlay to push data to the overlay — such as its suggested on-screen position. Use this when the overlay's position needs to be updated dynamically after the session is already active.

Method Signature​

setDataToOverlay(overlayData: OverlayData): void;

Parameters​

ParameterTypeDescription
overlayDataOverlayDataData to pass to the overlay.

OverlayData​

FieldTypeDescription
suggestedPosition{ x: number; y: number }Suggested overlay position in pixels. x is the offset from the right edge of the screen; y is the offset from the top.

Return Value​

This method does not return a value.

Example​

import { OverlayData } from '@maestro_io/maestro-web-sdk';

const event = SDK.getMaestroEventViewModel();

const overlayData: OverlayData = {
suggestedPosition: { x: 100, y: 50 },
};

event.setDataToOverlay(overlayData);

Notes​

  • suggestedPosition is required when calling setDataToOverlay.
  • To set the initial overlay position when the overlay is about to appear, implement onOverlayEvent on your delegate and respond to the will-appear event.
  • To check whether the overlay is currently visible, use isOverlayShowing.

See also​

  • Overlays — what an overlay is, how it is triggered, and its lifecycle.
  • Overlay Integration — step-by-step host integration, including repositioning a live overlay.