Skip to content

1681-engine / pixel / registerMaterial

Function: registerMaterial() ​

ts
function registerMaterial(name, material): void;

Defined in: src/pixel/ramp.ts:92

Adds a material, or changes a built-in one: how its shadows and lights drift (light) and the five factors its ramp is built from, darkest to brightest (factors, around 1: below darkens, above lifts). Register before painting with it; tones already worked out for that material are forgotten.

Parameters ​

ParameterType
namestring
material{ factors: RampFactors; light: MaterialLight; }
material.factorsRampFactors
material.lightMaterialLight

Returns ​

void

Released under the MIT License.