Description

Represents a texture file asset.

Example

// 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;
interface Texture {
    control: TextureProvider;
    name: string;
    uniqueIdentifier: string;
    copyFrame(): Texture;
    createMarkerAsset(): MarkerAsset;
    getColorspace(): Colorspace;
    getHeight(): number;
    getTypeName(): string;
    getWidth(): number;
    isOfType(type): boolean;
    isSame(other): boolean;
}

Hierarchy (view full)

Properties

Description

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

name: string

Description

The name of the Asset in Lens Studio.

uniqueIdentifier: string

Methods

  • Returns Texture

    Description

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

  • Returns number

    Description

    Returns the height of the texture.

  • Returns string

    Description

    Returns the name of this object's type.

  • Returns number

    Description

    Returns the width of the texture.

  • Parameters

    • type: string

    Returns boolean

    Description

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

  • Parameters

    Returns boolean

    Description

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

Generated using TypeDoc