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
Properties
color
Color of the line. Applies to all line segments. Defaults to White.
color Mode
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.
colors
Colors of the line segments. Defaults to empty.
colors Distribution Type
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.
colors Texture
You can provide a colorsTexture to use instead of one generated from the 'colors' option
dash Count
dash Offset
Dash offset
dash Ratio
Length of the dash. 0 to 1. 0.5 means half empty, half drawn.
resolution
Defaults to engine.getRenderWidth() and engine.getRenderHeight() Rendering resolution
size Attenuation
If false then width units = scene units. If true then line will width be reduced. Defaults to false.
use Colors
Whether to use the colors option to colorize the line
use Dash
Turns on/off dash mode
visibility
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
Line base width. At each point the line width is calculated by widths[pointIndex] * width
Methods
set Color
-
Allows to change the color without marking the material dirty. MATERIAL_TYPE_STANDARD and MATERIAL_TYPE_PBR material's shaders will get recompiled if there was no color set and you set a color or when there was a color set and you set it to null.
Returns void
set Colors
update Lazy
-
Creates and sets the colors texture from the colors array which was created in lazy mode
Returns void
Interface which defines the available methods for a GreasedLineMaterial