Lens Scripting API

    Class Texture

    Represents a texture file asset.

    // Print the texture's height, width
    // Change the texture's name and print it out
    //@input Asset.Texture texture

    print("Width = " + script.texture.getWidth().toString());
    print("Height = " + script.texture.getHeight().toString());
    // Takes a screenshot of device camera input and applies it to meshVisual
    //@input Asset.Texture deviceCameraTexture
    //@input Component.MeshVisual meshVisual
    var textureCopy = script.deviceCameraTexture.copyFrame();
    script.meshVisual.mainPass.baseTex = textureCopy;

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    The TextureProvider for the texture, which may control things like animation depending on the texture type. See also: AnimatedTextureFileProvider.

    name: string

    The name of the Asset in Lens Studio.

    uniqueIdentifier: string

    Methods

    • Returns a Texture that captures the current state of this Texture Asset.

      Returns Texture

    • Returns the height of the texture.

      Returns number

    • Returns the name of this object's type.

      Returns string

    • Returns the width of the texture.

      Returns number

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    MMNEPVFCICPMFPCPTTAAATR