Buffer:newReadback

Edit

Creates and returns a new Readback that will download the data in the Buffer from VRAM. Once the readback is complete, Readback:getData returns the data as a table, or Readback:getBlob returns the data as a Blob.

readback = Buffer:newReadback(offset, extent)

Arguments

NameTypeDefaultDescription
offsetnumber0 A byte offset to read from.
extentnumbernil The number of bytes to read. If nil, reads the rest of the buffer.

Returns

NameTypeDescription
readbackReadback A new Readback object.

Notes

The offset and extent arguments must be a multiple of the Buffer's stride (unless it was created without a format).

See also