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
| Parameter | Type | Description |
|---|---|---|
overlayData | OverlayData | Data to pass to the overlay. |
OverlayData
| Field | Type | Description |
|---|---|---|
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
suggestedPositionis required when callingsetDataToOverlay.- To set the initial overlay position when the overlay is about to appear, implement
onOverlayEventon your delegate and respond to thewill-appearevent. - To check whether the overlay is currently visible, use
isOverlayShowing.