The .drft container · function

readEnts

The scene an ENTS chunk carries.

Explained in The .drft container.

function readEnts(buffer: ArrayBuffer, offset: number, byteLength: number): EntsScene
import { readEnts } from '@driftengine/drft';

Parameters

ParameterTypeDescription
bufferArrayBuffer
offsetnumber
byteLengthnumber

In depth

A copy rather than a view, and it is the only chunk here that has to be. Text is not a typed array over the buffer; parsing it is what makes it a scene. A consumer that loads one is about to create every entity in it anyway, so the copy is not the cost that matters.