lovr.data.newTextureData

Creates a new TextureData with a given width and height or from an image file.

Load image data from a file.

textureData = lovr.data.newTextureData(filename)

Arguments

NameTypeDescription
filenamestringThe filename of the image to load.

Returns

NameTypeDescription
textureDataTextureDataThe new TextureData.

Create an empty TextureData, initializing all color components to 0.

textureData = lovr.data.newTextureData(width, height, format)

Arguments

NameTypeDefaultDescription
widthnumberThe width of the texture data.
heightnumberThe height of the texture data.
formatTextureFormatrgbaThe format of the texture's pixels.

Returns

NameTypeDescription
textureDataTextureDataThe new TextureData.

Decode image data from a Blob.

textureData = lovr.data.newTextureData(blob)

Arguments

NameTypeDescription
blobBlobThe Blob containing image data to decode.

Returns

NameTypeDescription
textureDataTextureDataThe new TextureData.

See also