lovr.data.newBlob

Creates a new Blob. A Blob is a piece of binary data.

blob = lovr.data.newBlob(size, name)

Arguments

NameTypeDefaultDescription
sizenumberThe amount of data to allocate for the Blob, in bytes. Its content will be set to zero.
namestring''A name for the Blob (used in error messages)

Returns

NameTypeDescription
blobBlobThe new Blob.

blob = lovr.data.newBlob(contents, name)

Arguments

NameTypeDefaultDescription
contentsstringA string containing the Blob's contents.
namestring''A name for the Blob (used in error messages)

Returns

NameTypeDescription
blobBlobThe new Blob.

blob = lovr.data.newBlob(source, name)

Arguments

NameTypeDefaultDescription
sourceBlobA Blob to copy the contents from.
namestring''A name for the Blob (used in error messages)

Returns

NameTypeDescription
blobBlobThe new Blob.

Notes

Note that TextureData and SoundData are Blobs and can be cloned using this function.

See also