LensStudio:Preview.Gesture
ClassBase class for all script-accessible Lens Studio objects.
Index
Properties
Methods
Example
// ScriptObject is the base class for all native editor objects.
// Use getTypeName() to identify type and Editor.isNull() to check validity.
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project.scene;
const so = scene.addSceneObject(scene.rootSceneObjects[0]);
so.name = 'ScriptObjectDemo';
// getTypeName() returns the native type name
console.log('Type name:', so.getTypeName());
// isOfType() checks type hierarchy
console.log('Is SceneObject:', so.isOfType('SceneObject'));
// Editor.isNull() checks if the native object is still valid
console.log('Is valid:', !Editor.isNull(so));
so.destroy();
console.log('After destroy, isNull:', Editor.isNull(so));
Extends
Extended by
Properties
positions
readonlypositions:vec2[]
state
readonlystate:GestureState
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