Available since LÖVE 11.0
This function is not supported in earlier versions.
Creates a new Data object containing arbitrary bytes.
Data:getPointer along with LuaJIT's FFI can be used to manipulate the contents of the ByteData object after it has been created.
This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused!
Creates a new ByteData by copying the contents of the specified string.
bytedata = love.data.newByteData( datastring )
string datastringByteData bytedataCreates a new ByteData by copying from an existing Data object.
bytedata = love.data.newByteData( data, offset, size )
Data datanumber offset (0)number size (data:getSize())ByteData bytedataCreates a new empty (zero-initialized) ByteData with the specific size.
bytedata = love.data.newByteData( size )
number sizeByteData bytedata
© 2006–2020 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.data.newByteData