The .drft container · function

buildSubs

u32 count, then per entry: u32 material, u32 name bytes, then the UTF-8 name.

Explained in The .drft container.

function buildSubs(subs: DrftSubs): Uint8Array
import { buildSubs } from '@driftengine/drft';

Parameters

ParameterTypeDescription
subsDrftSubs

In depth

Byte length rather than character count, because a name is text and text is not one byte a character — chêne is five characters and six bytes, and a reader counting characters would walk off the end of one entry into the next.