Skip to main content

LensStudio:Preview.Touch

Class

Base class for all script-accessible Lens Studio objects.

Index

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

Constructors

Constructor

new Touch(state, positions): Touch

Parameters

ParameterType
stateGestureState
positionsvec2[]

Returns

Touch

Overrides

Gesture.constructor

Properties

positions

readonly positions: vec2[]

Inherited from

Gesture.positions


state

readonly state: GestureState

Inherited from

Gesture.state

Methods

getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

Gesture.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Gesture.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

Gesture.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

Gesture.isSame