zeros()
Function in Runtime
A storage array of length zeroed structs of cls, a class a shader module exports: one range of the region.
import { zeros } from 'typeshade/runtime'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
function zeros<T extends object>(cls: ResourceClass<T, 'set'>, length: number): Buffer<T>Parameters
clsResourceClass<T, 'set'>lengthnumberhow many elements, a whole number.
Return value
Buffer<T>
the array, whose element i is set as ps.at(i).pos.set(…).
Exceptions
TypeErrorTypeErrorfor a value that is no class of a shader module, for an abstract class, for a struct with no storage layout, for a field namedset, which the host’s editor refuses already withTS8079(Amendment A5, D3), and for a length that is not a whole number.
Source
src/runtime/resource.ts, line 1034, at commit af54ddad5