Preparing search index...

    Module LensStudio:OverlayPlugin

    Module providing overlay plugin infrastructure for Lens Studio.

    // OverlayPlugin renders floating UI on top of the editor viewport.
    //
    // Key methods:
    // createWidget(parent) — build the overlay's widget tree
    // requestShow() — make the overlay visible
    // requestHide() — hide the overlay
    // deinit() — release resources on shutdown

    export class OverlayPluginExampleOverlay extends OverlayPlugin {
    connections: any[];
    root: Widget | null;
    static descriptor() {
    const d = new Descriptor();
    d.id = 'com.docs.OverlayPluginExample';
    d.name = 'OverlayPlugin Overview';
    d.description = 'Demonstrates a minimal OverlayPlugin';
    return d;
    }
    constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
    super(pluginSystem, descriptor);
    this.connections = [];
    this.root = null;
    }
    createWidget(parent: Widget): Widget {
    this.root = new Widget(parent);
    const layout = new BoxLayout();
    layout.setDirection(Direction.TopToBottom);
    layout.spacing = 8;
    this.root.layout = layout;

    const label = new Label(this.root);
    label.text = 'Overlay is visible';
    layout.addWidget(label);

    const hideBtn = new PushButton(this.root);
    hideBtn.text = 'Hide Overlay';
    this.connections.push(hideBtn.onClick.connect(() => this.requestHide()));
    layout.addWidget(hideBtn);

    return this.root;
    }
    deinit(): void {
    this.connections.forEach((c: any) => c?.disconnect());
    this.connections = [];
    if (this.root) { this.root.deleteLater(); this.root = null; }
    }
    }

    Classes

    Descriptor
    OverlayPlugin