Editor Scripting API
    Preparing search index...

    Script Assets are text files that contain the code you write for your Lens. Scripts are written in Javascript or TypeScript.

    ///@input string stringToPrint = "Print this on Tap"
    //@input int testIntProperty = 7
    //@input int[] testIntArray = {1, 2, 3}

    scriptAsset.stringToPrint = "New String";
    scriptAsset.testIntProperty = 9;
    scriptAsset.testIntArray = [4,5,6];

    // set icon
    const buffer = Editor.FileSystem.readTextAll(path to svg file)
    const newIcon = Editor.Icon.setIconFromSVGData(buffer)
    scriptAsset.icon = newIcon;
    // getIcon
    const icon = scriptAsset.icon

    // set description
    scriptAsset.description = "helloWorld"
    // get description
    const desc = scriptAsset.description

    // hide input
    scriptAsset.setScriptInputHidden("myInputName", true);

    // unhide input
    scriptAsset.setScriptInputHidden("myInputName", true);

    // check visibility of input
    scriptAsset.isScriptInputHidden("myInputName");

    Hierarchy (View Summary)

    Index

    Properties

    attachments: Editor.Assets.Asset[]
    cacheFile: Path
    componentId: Uuid

    Id associated with the script asset.

    description: string

    Description associated with the script asset

    exportId: Uuid

    Export id associated with the script asset.

    icon: Editor.Icon

    Icon associated with the script asset.

    id: Uuid

    The unique id of the entity.

    meta: Meta
    name: string

    The name of the asset.

    tags: string[]
    type: string

    The entity's type.

    version: Version

    Version associated with the script asset.

    Methods

    • Parameters

      • type: string

      Returns boolean

    • Returns true if the script inpput is hidden from the scene.

      Parameters

      • inputName: string

      Returns boolean

    • Used when you'd like to hide inputs from users in the scene.

      Parameters

      • inputName: string
      • hidden: boolean

      Returns void