Blob

Edit

A Blob is an object that holds binary data. It can be passed to most functions that take filename arguments, like lovr.graphics.newModel or lovr.audio.newSource. Blobs aren't usually necessary for simple projects, but they can be really helpful if:

A Blob's size cannot be changed once it is created.

Constructors

lovr.data.newBlobCreate a new Blob.
lovr.filesystem.newBlobCreate a new Blob from a file.

Methods

Blob:getSizeGet the size of the Blob, in bytes.
Blob:getNameGet the label of the Blob.
Blob:getPointerGet a raw pointer to the Blob's data.
Blob:getStringGet the Blob's contents as a string.
Blob:getI8Unpack signed 8-bit integers from the Blob.
Blob:getU8Unpack unsigned 8-bit integers from the Blob.
Blob:getI16Unpack signed 16-bit integers from the Blob.
Blob:getU16Unpack unsigned 16-bit integers from the Blob.
Blob:getI32Unpack signed 32-bit integers from the Blob.
Blob:getU32Unpack unsigned 32-bit integers from the Blob.
Blob:getF32Unpack 32-bit floating point numbers from the Blob.
Blob:getF64Unpack 64-bit floating point numbers from the Blob.

See also