The .drft container · function
readEnts
The scene an ENTS chunk carries.
Explained in The .drft container.
function readEnts(buffer: ArrayBuffer, offset: number, byteLength: number): EntsSceneimport { readEnts } from '@driftengine/drft';Parameters
| Parameter | Type | Description |
|---|---|---|
buffer | ArrayBuffer | |
offset | number | |
byteLength | number |
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.