Module for registering and managing project settings panels in Lens Studio.
Example
// LensStudio:ProjectSettingsPlugin adds a custom panel to the Lens Studio // Project Settings dialog. Subclass ProjectSettingsPlugin, return a // Descriptor describing how the entry appears (id, name, section, title, // icon), and build the panel UI in createWidget(). The plugin needs Ui.IGui // in its dependencies so the parent widget hierarchy is available. import { ProjectSettingsPlugin, Descriptor } from'LensStudio:ProjectSettingsPlugin'; import*asUifrom'LensStudio:Ui';
exportclassProjectSettingsPluginExampleSettingsextendsProjectSettingsPlugin { connections: any[]; root: Ui.Widget | null; staticdescriptor(): Descriptor { constd = newDescriptor(); d.id = 'com.docs.ProjectSettingsPluginExample'; d.name = 'Example Settings'; d.description = 'Demonstrates a minimal ProjectSettingsPlugin'; d.title = 'Example Settings'; d.section = 'General Settings'; // Bundle an .svg/.png next to the plugin's main module and resolve it // with import.meta.resolve so the icon ships with the plugin. d.icon = Editor.Icon.fromFile(newEditor.Path(import.meta.resolve('icon.svg'))); d.dependencies = [Ui.IGui]; returnd; } constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) { super(pluginSystem, descriptor); this.connections = []; this.root = null; } createWidget(parent: Ui.Widget): Ui.Widget { this.root = newUi.Widget(parent); constlayout = newUi.BoxLayout(); layout.setDirection(Ui.Direction.TopToBottom);
constlabel = newUi.Label(this.root); label.text = 'Hello from a Project Settings plugin'; layout.addWidget(label); layout.addStretch(1);
Module for registering and managing project settings panels in Lens Studio.
Example