API

Interface IGreasedLineMaterial

Interface which defines the available methods for a GreasedLineMaterial

interface IGreasedLineMaterial {
    color: Nullable<Color3>;
    colorMode: GreasedLineMeshColorMode;
    colors: Nullable<Color3[]>;
    colorsDistributionType: GreasedLineMeshColorDistributionType;
    colorsTexture: Nullable<RawTexture>;
    dashCount: number;
    dashOffset: number;
    dashRatio: number;
    resolution: Vector2;
    sizeAttenuation: boolean;
    useColors: boolean;
    useDash: boolean;
    visibility: number;
    width: number;
    setColor(value: Nullable<Color3>, doNotMarkDirty?: boolean): void;
    setColors(
        colors: Nullable<Color3[]>,
        lazy: boolean,
        forceNewTexture?: boolean,
    ): void;
    updateLazy(): void;
}

Implemented by

Index

Color of the line. Applies to all line segments. Defaults to White.

The mixing mode of the color paramater. Default value is GreasedLineMeshColorMode.SET. MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material. MATERIAL_TYPE_STANDARD and MATERIAL_TYPE_PBR mixes the color from the base material with the color and/or colors of the greased line material.

GreasedLineMeshColorMode

colors: Nullable<Color3[]>

Colors of the line segments. Defaults to empty.

colorsDistributionType: GreasedLineMeshColorDistributionType

The method used to distribute the colors along the line. You can use segment distribution when each segment will use on color from the color table. Or you can use line distribution when the colors are distributed evenly along the line ignoring the segments.

colorsTexture: Nullable<RawTexture>

You can provide a colorsTexture to use instead of one generated from the 'colors' option

dashCount: number

GreasedLinePluginMaterial.setDashCount Number of dashes in the line. Defaults to 1.

dashOffset: number

Dash offset

dashRatio: number

Length of the dash. 0 to 1. 0.5 means half empty, half drawn.

resolution: Vector2

Defaults to engine.getRenderWidth() and engine.getRenderHeight() Rendering resolution

sizeAttenuation: boolean

If false then width units = scene units. If true then line will width be reduced. Defaults to false.

useColors: boolean

Whether to use the colors option to colorize the line

useDash: boolean

Turns on/off dash mode

visibility: number

Normalized value of how much of the line will be visible 0 - 0% of the line will be visible 1 - 100% of the line will be visible

width: number

Line base width. At each point the line width is calculated by widths[pointIndex] * width