LensStudio:ProjectSettingsPlugin.Descriptor
ClassConfiguration descriptor for a project settings plugin, holding the section and title used to register the panel.
Index
Properties
Methods
Example
// Descriptor (from LensStudio:ProjectSettingsPlugin) extends BaseDescriptor
// and supplies metadata for a settings panel entry: id, name, description,
// section, title, icon, and dependencies. Lens Studio reads it from your
// plugin's static descriptor() method to register the panel.
import { ProjectSettingsPlugin, Descriptor } from 'LensStudio:ProjectSettingsPlugin';
import * as Ui from 'LensStudio:Ui';
export class MySettingsPlugin extends ProjectSettingsPlugin {
root: Ui.Widget | null = null;
static descriptor(): Descriptor {
const d = new Descriptor();
d.id = 'com.docs.ProjectSettingsDescriptorExample';
d.name = 'My Settings';
d.description = 'A minimal project settings panel';
d.section = 'General Settings';
d.title = 'My Custom Settings';
// Icon resolved via import.meta.resolve so a bundled icon.svg/png next
// to the plugin's main module ships with the plugin and is always found.
d.icon = Editor.Icon.fromFile(new Editor.Path(import.meta.resolve('icon.svg')));
d.dependencies = [Ui.IGui];
return d;
}
createWidget(parent: Ui.Widget): Ui.Widget {
this.root = new Ui.Widget(parent);
const layout = new Ui.BoxLayout();
layout.setDirection(Ui.Direction.TopToBottom);
const label = new Ui.Label(this.root);
label.text = 'Hello from My Settings';
layout.addWidget(label);
layout.addStretch(1);
this.root.layout = layout;
return this.root;
}
deinit(): void {
if (this.root) { this.root.deleteLater(); this.root = null; }
}
}
Extends
Constructors
Constructor
new Descriptor():
Descriptor
Constructs a new Descriptor instance for configuring a project settings plugin entry.
Returns
Descriptor
Overrides
BaseDescriptor.constructor
Properties
dependencies
dependencies:
InterfaceId[]
Array of interface IDs that this plugin requires to function.
Inherited from
description
description:
string
Human-readable description of the plugin shown in the plugin manager.
Inherited from
icon
icon:
Icon
Icon displayed for the settings panel entry.
id
id:
string
Unique identifier for the plugin, typically in reverse domain notation.
Inherited from
intendedPlatforms
intendedPlatforms:
TargetPlatform[]
Array of target platforms (Snapchat, Spectacles) where this plugin is intended to run.
Inherited from
BaseDescriptor.intendedPlatforms
interfaces
interfaces:
InterfaceId[]
Array of interface IDs that this plugin provides or implements.
Inherited from
name
name:
string
Display name of the plugin.
Inherited from
priority
priority:
number
section
section:
string
Section name under which this settings panel is grouped.
title
title:
string
Display title shown for this settings panel entry.
Methods
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean