Lens Scripting API
    Preparing search index...

    The LineRenderer is a custom component that draws a line in 3D space with RenderMeshVisual. It uses MeshBuilder to programmatically generate a line strip given a list of points provided by the user.

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    _alpha: number = 1
    attachedToScene: boolean = false
    childViews: default<any>[] = []
    container: SceneObject
    isDestroyed: boolean = false
    material: Material = ...
    onCreateView: PublicApi<default<any>> = ...
    onDestroyView: PublicApi<default<any>> = ...
    onEnabled: PublicApi<boolean> = ...

    Accessors

    • get alpha(): number

      Returns the current alpha of the view

      Returns number

    • set alpha(a: number): void

      Parameters

      • a: number

      Returns void

    • get config(): Config

      Returns Config

    • get endColor(): vec4

      Gets the color of the line at the end.

      Returns vec4

    • set endColor(color: vec4): void

      Sets the color of the line at the end.

      Parameters

      Returns void

    • get endWidth(): number

      Gets the width of the line at the end.

      Returns number

    • set endWidth(newWidth: number): void

      Sets the width of the line at the end.

      Parameters

      • newWidth: number

      Returns void

    • get localPosition(): vec3

      Returns vec3

    • set localPosition(position: vec3): void

      Parameters

      Returns void

    • get localRotation(): quat

      Returns quat

    • set localRotation(rotation: quat): void

      Parameters

      Returns void

    • get localScale(): number

      Return the local scale of an object, assuming uniform scaling

      Returns number

    • set localScale(scale: number): void

      Parameters

      • scale: number

      Returns void

    • get localScaleVec3(): vec3

      Returns vec3

    • set localScaleVec3(vec: vec3): void

      Parameters

      Returns void

    • get lookAtCamera(): boolean

      Returns boolean

    • set lookAtCamera(isEnabled: boolean): void

      Parameters

      • isEnabled: boolean

      Returns void

    • get name(): string

      Returns string

    • get points(): vec3[]

      Returns a shallow copy of the array of points that the LineRenderer will draw a line between.

      Returns vec3[]

    • set points(points: vec3[]): void

      Set the array of points that the LineRenderer will draw a line between.

      Parameters

      Returns void

    • get position(): vec3

      Returns vec3

      use localPosition instead

    • set position(position: vec3): void

      Parameters

      Returns void

      pleasre use localPosition

    • set scale(scale: number): void

      Parameters

      • scale: number

      Returns void

      use localScale instead

    • get startColor(): vec4

      Gets the color of the line at the start.

      Returns vec4

    • set startColor(color: vec4): void

      Sets the color of the line at the start.

      Parameters

      Returns void

    • get startWidth(): number

      Gets the width of the line at the start.

      Returns number

    • set startWidth(newWidth: number): void

      Sets the width of the line at the start.

      Parameters

      • newWidth: number

      Returns void

    • get worldPosition(): vec3

      Returns vec3

    • set worldPosition(position: vec3): void

      Parameters

      Returns void

    • get worldRotation(): quat

      Returns quat

    • set worldRotation(rotation: quat): void

      Parameters

      Returns void

    • get worldScale(): number

      Returns number

    • set worldScale(scale: number): void

      Parameters

      • scale: number

      Returns void

    • get worldScaleVec3(): vec3

      Returns vec3

    • set worldScaleVec3(scale: vec3): void

      Parameters

      Returns void

    Methods

    • Type Parameters

      Parameters

      • child: Child
      • Optionalconfigure: (c: Child) => void
      • preserveWorldTransform: boolean = false

      Returns Child

    • Destroys and removes the child from this View

      Type Parameters

      Parameters

      • child: Child

        the child to be destroyed

      Returns boolean

      whether the child was destroyed

    • Detaches child from parent and removes the child from this View

      Type Parameters

      Parameters

      • child: Child

        the child to be detached

      Returns boolean

      whether the child was detached

    • Type Parameters

      • Conf
      • Child extends default<
            Conf extends Partial<
                {
                    defaults: Partial;
                    enabled: boolean;
                    name: string;
                    position: vec3;
                    rotation: quat;
                    scale: number;
                },
            >
                ? Conf<Conf>
                : never,
        >

      Parameters

      Returns Child

    • Parameters

      • defaults: Partial
      • parentView: default<
            Partial<
                {
                    defaults: Partial;
                    enabled: boolean;
                    name: string;
                    position: vec3;
                    rotation: quat;
                    scale: number;
                },
            >,
        >

      Returns void

    • Type Parameters

      Parameters

      Returns void

    • Set the alpha of the View to a, and recursively apply this alpha to all descendents. The alpha will be applied by setting the .a component of baseColor to a.

      Parameters

      • a: number

        The value to set the alpha of the view to, from 0 to 1

      Returns void

    • Parameters

      • enabled: boolean

      Returns void

    • Sets line to a single solid color instead of a gradient

      Parameters

      • color: vec4

        color of the line

      Returns void

    • Updates position of point (in this._points) at the indicated index

      Parameters

      • index: number

        (index in the points[] array) of the vertex to be changed

      • newPos: vec3

        the vertex's new position

      Returns void

    MMNEPVFCICPMFPCPTTAAATR