Skip to content

material

__index

material[{name: string}] -> material_var

Finds a KeyValues parameter.

Parameters

Name Type Description
name string Parameter name

Usage

local var = my_mat['$color'];

modulate

modulate(col: table)

Modulates material's color.

Parameters

Name Type Description
col table{r, g, b, a} New color

Usage

my_mat:modulate(render.color('#fff'));

set_flat

set_flag(flag: number, val: bool)

Sets a material flag.

Parameters

Name Type Description
flag number Flag
val bool New value

Usage

my_mat:set_flag(mat.var_ignorez, true);

get_flag

get_flag(flag: number) -> bool

Gets a material flag value.

Parameters

Name Type Description
flag number Flag

Usage

if my_mat:get_flag(mat.var_ignorez) then
    -- ...
end

find_var

find_var(name: string) -> material_var

Finds a KeyValues parameter.

Parameters

Name Type Description
name string Parameter name

Usage

local var = my_mat:find_var('$color');

get_name

get_name() -> string

Returns material's name.

Usage

local name = my_mat:get_name();

get_group

get_group() -> string

Returns material's texture group.

Usage

local group = my_mat:get_group();