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 datastring
ByteData bytedata
Creates a new ByteData by copying from an existing Data object.
bytedata = love.data.newByteData( data, offset, size )
Data Data
number offset (0)
number size (data:getSize())
ByteData bytedata
Creates a new empty ByteData with the specific size.
bytedata = love.data.newByteData( size )
number size
ByteData bytedata