Nocare3/love2dapi_chunks huggingface dataset:
SpriteBatch:setLayer
Changes a sprite previously added with add or addLayer, in a batch created with an Array Texture.
SpriteBatch:setLayer( spriteindex, layerindex, x, y, r, sx, sy, ox, oy, kx, ky )
spriteindex number The index of the existing sprite to replace.
layerindex number The index of the layer in the Array Texture to use for this sprite.
x (0) number The position to draw the sprite (x-axis).
y (0) number The position to draw the sprite (y-axis).
r (0) number Orientation (radians).
sx (1) number Scale factor (x-axis).
sy (sx) number Scale factor (y-axis).
ox (0) number Origin offset (x-axis).
oy (0) number Origin offset (y-axis).
kx (0) number Shearing factor (x-axis).
ky (0) number Shearing factor (y-axis).
SpriteBatch:setLayer( spriteindex, layerindex, quad, x, y, r, sx, sy, ox, oy, kx, ky )
spriteindex number The index of the existing sprite to replace.
layerindex number The index of the layer to use for this sprite.
quad Quad The subsection of the texture's layer to use when drawing the sprite.
x (0) number The position to draw the sprite (x-axis).
y (0) number The position to draw the sprite (y-axis).
r (0) number Orientation (radians).
sx (1) number Scale factor (x-axis).
sy (sx) number Scale factor (y-axis).
ox (0) number Origin offset (x-axis).
oy (0) number Origin offset (y-axis).
kx (0) number Shearing factor (x-axis).
ky (0) number Shearing factor (y-axis).
SpriteBatch:setLayer( spriteindex, layerindex, transform )
spriteindex number The index of the existing sprite to replace.
layerindex number The index of the layer to use for the sprite.
transform Transform A transform object.
SpriteBatch:setLayer( spriteindex, layerindex, quad, transform )
spriteindex number The index of the existing sprite to replace.
layerindex number The index of the layer to use for the sprite.
quad Quad The subsection of the texture's layer to use when drawing the sprite.
transform Transform A transform object.
SpriteBatch:setTexture
Sets the texture (Image or Canvas) used for the sprites in the batch, when drawing.
SpriteBatch:setTexture( texture )
texture Texture The new Image or Canvas to use for the sprites in the batch.
Text:add
Adds additional colored text to the Text object at the specified position.
index = Text:add( textstring, x, y, angle, sx, sy, ox, oy, kx, ky )
textstring string The text to add to the object.
x (0) number The position of the new text on the x-axis.
y (0) number The position of the new text on the y-axis.
angle (0) number The orientation of the new text in radians.
sx (1) number Scale factor on the x-axis.
sy (sx) number Scale factor on the y-axis.
ox (0) number Origin offset on the x-axis.
oy (0) number Origin offset on the y-axis.
kx (0) number Shearing / skew factor on the x-axis.
ky (0) number Shearing / skew factor on the y-axis.
index number An index number that can be used with Text:getWidth or Text:getHeight.
index = Text:add( coloredtext, x, y, angle, sx, sy, ox, oy, kx, ky )
coloredtext table A table containing colors and strings to add to the object, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1 table A table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1 string A string of text which has a color specified by the previous color.
coloredtext.color2 table A table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2 string A string of text which has a color specified by the previous color.
coloredtext.... tables and strings Additional colors and strings.
x (0) number The position of the new text on the x-axis.
y (0) number The position of the new text on the y-axis.
angle (0) number The orientation of the new text in radians.
sx (1) number Scale factor on the x-axis.
sy (sx) number Scale factor on the y-axis.
ox (0) number Origin offset on the x-axis.
oy (0) number Origin offset on the y-axis.
kx (0) number Shearing / skew factor on the x-axis.
ky (0) number Shearing / skew factor on the y-axis.
index number An index number that can be used with Text:getWidth or Text:getHeight.
Text:addf
Adds additional formatted / colored text to the Text object at the specified position.

The word wrap limit is applied before any scaling, rotation, and other coordinate transformations. Therefore the amount of text per line stays constant given the same wrap limit, even if the scale arguments change.
index = Text:addf( textstring, wraplimit, align, x, y, angle, sx, sy, ox, oy, kx, ky )
textstring string The text to add to the object.
wraplimit number The maximum width in pixels of the text before it gets automatically wrapped to a new line.
align AlignMode The alignment of the text.
x number The position of the new text (x-axis).
y number The position of the new text (y-axis).
angle (0) number Orientation (radians).
sx (1) number Scale factor (x-axis).
sy (sx) number Scale factor (y-axis).
ox (0) number Origin offset (x-axis).
oy (0) number Origin offset (y-axis).
kx (0) number Shearing / skew factor (x-axis).
ky (0) number Shearing / skew factor (y-axis).
index number An index number that can be used with Text:getWidth or Text:getHeight.
index = Text:addf( coloredtext, wraplimit, align, x, y, angle, sx, sy, ox, oy, kx, ky )
coloredtext table A table containing colors and strings to add to the object, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1 table A table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1 string A string of text which has a color specified by the previous color.
coloredtext.color2 table A table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2 string A string of text which has a color specified by the previous color.
coloredtext.... tables and strings Additional colors and strings.
wraplimit number The maximum width in pixels of the text before it gets automatically wrapped to a new line.
align AlignMode The alignment of the text.
x number The position of the new text (x-axis).
y number The position of the new text (y-axis).
angle (0) number Orientation (radians).
sx (1) number Scale factor (x-axis).
sy (sx) number Scale factor (y-axis).
ox (0) number Origin offset (x-axis).
oy (0) number Origin offset (y-axis).
kx (0) number Shearing / skew factor (x-axis).
ky (0) number Shearing / skew factor (y-axis).
index number An index number that can be used with Text:getWidth or Text:getHeight.
Text:getDimensions
Gets the width and height of the text in pixels.
width, height = Text:getDimensions()
width number The width of the text. If multiple sub-strings have been added with Text:add, the width of the last sub-string is returned.
height number The height of the text. If multiple sub-strings have been added with Text:add, the height of the last sub-string is returned.
width, height = Text:getDimensions( index )
index number An index number returned by Text:add or Text:addf.
width number The width of the sub-string (before scaling and other transformations).
height number The height of the sub-string (before scaling and other transformations).
Text:getFont
Gets the Font used with the Text object.
font = Text:getFont()
font Font The font used with this Text object.
Text:getHeight
Gets the height of the text in pixels.
height = Text:getHeight()
height number The height of the text. If multiple sub-strings have been added with Text:add, the height of the last sub-string is returned.
height = Text:getHeight( index )
index number An index number returned by Text:add or Text:addf.
height number The height of the sub-string (before scaling and other transformations).
Text:getWidth
Gets the width of the text in pixels.
width = Text:getWidth()
width number The width of the text. If multiple sub-strings have been added with Text:add, the width of the last sub-string is returned.
width = Text:getWidth( index )
index number An index number returned by Text:add or Text:addf.
width number The width of the sub-string (before scaling and other transformations).
Text:set
Replaces the contents of the Text object with a new unformatted string.
Text:set( textstring )
textstring string The new string of text to use.
Text:set( coloredtext )
coloredtext table A table containing colors and strings to use as the new text, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1 table A table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1 string A string of text which has a color specified by the previous color.
coloredtext.color2 table A table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2 string A string of text which has a color specified by the previous color.
coloredtext.... tables and strings Additional colors and strings.
Text:setFont
Replaces the Font used with the text.
Text:setFont( font )
font Font The new font to use with this Text object.
Text:setf
Replaces the contents of the Text object with a new formatted string.
Text:setf( textstring, wraplimit, align )
textstring string The new string of text to use.
wraplimit number The maximum width in pixels of the text before it gets automatically wrapped to a new line.
align AlignMode The alignment of the text.
Text:setf( coloredtext, wraplimit, align )
coloredtext table A table containing colors and strings to use as the new text, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1 table A table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1 string A string of text which has a color specified by the previous color.
coloredtext.color2 table A table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2 string A string of text which has a color specified by the previous color.
coloredtext.... tables and strings Additional colors and strings.
wraplimit number The maximum width in pixels of the text before it gets automatically wrapped to a new line.
align AlignMode The alignment of the text.
Texture:getDPIScale
Gets the DPI scale factor of the Texture.

The DPI scale factor represents relative pixel density. A DPI scale factor of 2 means the texture has twice the pixel density in each dimension (4 times as many pixels in the same area) compared to a texture with a DPI scale factor of 1.

For example, a texture with pixel dimensions of 100x100 with a DPI scale factor of 2 will be drawn as if it was 50x50. This is useful with high-dpi / retina displays to easily allow swapping out higher or lower pixel density Images and Canvases without needing any extra manual scaling logic.
dpiscale = Texture:getDPIScale()
dpiscale number The DPI scale factor of the Texture.
Texture:getDepth
Gets the depth of a Volume Texture. Returns 1 for 2D, Cubemap, and Array textures.
depth = Texture:getDepth()
depth number The depth of the volume Texture.
Texture:getDepthSampleMode
Gets the comparison mode used when sampling from a depth texture in a shader.

Depth texture comparison modes are advanced low-level functionality typically used with shadow mapping in 3D.
compare = Texture:getDepthSampleMode()
compare (nil) CompareMode The comparison mode used when sampling from this texture in a shader, or nil if setDepthSampleMode has not been called on this Texture.
Texture:getDimensions
Gets the width and height of the Texture.
width, height = Texture:getDimensions()
width number The width of the Texture.
height number The height of the Texture.
Texture:getFilter
Gets the filter mode of the Texture.
min, mag, anisotropy = Texture:getFilter()
min FilterMode Filter mode to use when minifying the texture (rendering it at a smaller size on-screen than its size in pixels).
mag FilterMode Filter mode to use when magnifying the texture (rendering it at a smaller size on-screen than its size in pixels).
anisotropy number Maximum amount of anisotropic filtering used.
Texture:getFormat
Gets the pixel format of the Texture.
format = Texture:getFormat()
format PixelFormat The pixel format the Texture was created with.
Texture:getHeight
Gets the height of the Texture.
height = Texture:getHeight()
height number The height of the Texture.
Texture:getLayerCount
Gets the number of layers / slices in an Array Texture. Returns 1 for 2D, Cubemap, and Volume textures.
layers = Texture:getLayerCount()
layers number The number of layers in the Array Texture.
Texture:getMipmapCount
Gets the number of mipmaps contained in the Texture. If the texture was not created with mipmaps, it will return 1.
mipmaps = Texture:getMipmapCount()
mipmaps number The number of mipmaps in the Texture.
Texture:getMipmapFilter
Gets the mipmap filter mode for a Texture. Prior to 11.0 this method only worked on Images.
mode, sharpness = Texture:getMipmapFilter()
mode FilterMode The filter mode used in between mipmap levels. nil if mipmap filtering is not enabled.
sharpness number Value used to determine whether the image should use more or less detailed mipmap levels than normal when drawing.
Texture:getPixelDimensions
Gets the width and height in pixels of the Texture.

Texture:getDimensions gets the dimensions of the texture in units scaled by the texture's DPI scale factor, rather than pixels. Use getDimensions for calculations related to drawing the texture (calculating an origin offset, for example), and getPixelDimensions only when dealing specifically with pixels, for example when using Canvas:newImageData.
pixelwidth, pixelheight = Texture:getPixelDimensions()
pixelwidth number The width of the Texture, in pixels.
pixelheight number The height of the Texture, in pixels.
Texture:getPixelHeight
Gets the height in pixels of the Texture.

DPI scale factor, rather than pixels. Use getHeight for calculations related to drawing the texture (calculating an origin offset, for example), and getPixelHeight only when dealing specifically with pixels, for example when using Canvas:newImageData.
pixelheight = Texture:getPixelHeight()
pixelheight number The height of the Texture, in pixels.
Texture:getPixelWidth
Gets the width in pixels of the Texture.

DPI scale factor, rather than pixels. Use getWidth for calculations related to drawing the texture (calculating an origin offset, for example), and getPixelWidth only when dealing specifically with pixels, for example when using Canvas:newImageData.
pixelwidth = Texture:getPixelWidth()
pixelwidth number The width of the Texture, in pixels.
Texture:getTextureType
Gets the type of the Texture.
texturetype = Texture:getTextureType()
texturetype TextureType The type of the Texture.
Texture:getWidth
Gets the width of the Texture.
width = Texture:getWidth()
width number The width of the Texture.
Texture:getWrap
Gets the wrapping properties of a Texture.

This function returns the currently set horizontal and vertical wrapping modes for the texture.
horiz, vert, depth = Texture:getWrap()
horiz WrapMode Horizontal wrapping mode of the texture.
vert WrapMode Vertical wrapping mode of the texture.
depth WrapMode Wrapping mode for the z-axis of a Volume texture.
Texture:isReadable
Gets whether the Texture can be drawn and sent to a Shader.

Canvases created with stencil and/or depth PixelFormats are not readable by default, unless readable=true is specified in the settings table passed into love.graphics.newCanvas.

Non-readable Canvases can still be rendered to.
readable = Texture:isReadable()
readable boolean Whether the Texture is readable.
Texture:setDepthSampleMode
Sets the comparison mode used when sampling from a depth texture in a shader. Depth texture comparison modes are advanced low-level functionality typically used with shadow mapping in 3D.

When using a depth texture with a comparison mode set in a shader, it must be declared as a sampler2DShadow and used in a GLSL 3 Shader. The result of accessing the texture in the shader will return a float between 0 and 1, proportional to the number of samples (up to 4 samples will be used if bilinear filtering is enabled) that passed the test set by the comparison operation.

Depth texture comparison can only be used with readable depth-formatted Canvases.
Texture:setDepthSampleMode( compare )
compare CompareMode The comparison mode used when sampling from this texture in a shader.
Texture:setFilter
Sets the filter mode of the Texture.
Texture:setFilter( min, mag, anisotropy )
min FilterMode Filter mode to use when minifying the texture (rendering it at a smaller size on-screen than its size in pixels).
mag (min) FilterMode Filter mode to use when magnifying the texture (rendering it at a larger size on-screen than its size in pixels).
anisotropy (1) number Maximum amount of anisotropic filtering to use.
Texture:setMipmapFilter
Sets the mipmap filter mode for a Texture. Prior to 11.0 this method only worked on Images.

Mipmapping is useful when drawing a texture at a reduced scale. It can improve performance and reduce aliasing issues.

In created with the mipmaps flag enabled for the mipmap filter to have any effect. In versions prior to 0.10.0 it's best to call this method directly after creating the image with love.graphics.newImage, to avoid bugs in certain graphics drivers.

Due to hardware restrictions and driver bugs, in versions prior to 0.10.0 images that weren't loaded from a CompressedData must have power-of-two dimensions (64x64, 512x256, etc.) to use mipmaps.
Texture:setMipmapFilter( filtermode, sharpness )
filtermode FilterMode The filter mode to use in between mipmap levels. 'nearest' will often give better performance.
sharpness (0) number A positive sharpness value makes the texture use a more detailed mipmap level when drawing, at the expense of performance. A negative value does the reverse.
Texture:setMipmapFilter()
Texture:setWrap
Sets the wrapping properties of a Texture.

This function sets the way a Texture is repeated when it is drawn with a Quad that is larger than the texture's extent, or when a custom Shader is used which uses texture coordinates outside of [0, 1]. A texture may be clamped or set to repeat in both horizontal and vertical directions.

Clamped textures appear only once (with the edges of the texture stretching to fill the extent of the Quad), whereas repeated ones repeat as many times as there is room in the Quad.
Texture:setWrap( horiz, vert, depth )
horiz WrapMode Horizontal wrapping mode of the texture.
vert (horiz) WrapMode Vertical wrapping mode of the texture.
depth (horiz) WrapMode Wrapping mode for the z-axis of a Volume texture.
Video:getDimensions
Gets the width and height of the Video in pixels.
width, height = Video:getDimensions()
width number The width of the Video.
height number The height of the Video.
Video:getFilter
Gets the scaling filters used when drawing the Video.
min, mag, anisotropy = Video:getFilter()
min FilterMode The filter mode used when scaling the Video down.
mag FilterMode The filter mode used when scaling the Video up.
anisotropy number Maximum amount of anisotropic filtering used.
Video:getHeight
Gets the height of the Video in pixels.
height = Video:getHeight()
height number The height of the Video.
Video:getSource
Gets the audio Source used for playing back the video's audio. May return nil if the video has no audio, or if Video:setSource is called with a nil argument.
source = Video:getSource()
source Source The audio Source used for audio playback, or nil if the video has no audio.
Video:getStream
Gets the VideoStream object used for decoding and controlling the video.
stream = Video:getStream()
stream VideoStream The VideoStream used for decoding and controlling the video.
Video:getWidth
Gets the width of the Video in pixels.
width = Video:getWidth()
width number The width of the Video.
Video:isPlaying
Gets whether the Video is currently playing.
playing = Video:isPlaying()
playing boolean Whether the video is playing.
Video:play
Starts playing the Video. In order for the video to appear onscreen it must be drawn with love.graphics.draw.
Video:play()
Video:rewind
Rewinds the Video to the beginning.
Video:rewind()
Video:seek
Sets the current playback position of the Video.
Video:seek( offset )
offset number The time in seconds since the beginning of the Video.
Video:setFilter
Sets the scaling filters used when drawing the Video.
Video:setFilter( min, mag, anisotropy )
min FilterMode The filter mode used when scaling the Video down.
mag FilterMode The filter mode used when scaling the Video up.
anisotropy (1) number Maximum amount of anisotropic filtering used.
Video:setSource
Sets the audio Source used for playing back the video's audio. The audio Source also controls playback speed and synchronization.
Video:setSource( source )
source (nil) Source The audio Source used for audio playback, or nil to disable audio synchronization.
Video:tell
Gets the current playback position of the Video.
seconds = Video:tell()
seconds number The time in seconds since the beginning of the Video.
love.image.isCompressed
Determines whether a file can be loaded as CompressedImageData.
compressed = love.image.isCompressed( filename )
filename string The filename of the potentially compressed image file.
compressed boolean Whether the file can be loaded as CompressedImageData or not.
compressed = love.image.isCompressed( fileData )
fileData FileData A FileData potentially containing a compressed image.
compressed boolean Whether the FileData can be loaded as CompressedImageData or not.
love.image.newCompressedData
Create a new CompressedImageData object from a compressed image file. LÖVE supports several compressed texture formats, enumerated in the CompressedImageFormat page.
compressedImageData = love.image.newCompressedData( filename )
filename string The filename of the compressed image file.
compressedImageData CompressedImageData The new CompressedImageData object.
compressedImageData = love.image.newCompressedData( fileData )
fileData FileData A FileData containing a compressed image.
compressedImageData CompressedImageData The new CompressedImageData object.
love.image.newImageData
Creates a new ImageData object.
imageData = love.image.newImageData( width, height )
width number The width of the ImageData.
height number The height of the ImageData.
imageData ImageData The new blank ImageData object. Each pixel's color values, (including the alpha values!) will be set to zero.
imageData = love.image.newImageData( width, height, format, data )
width number The width of the ImageData.
height number The height of the ImageData.
format ('rgba8') PixelFormat The pixel format of the ImageData.
data (nil) string Optional raw byte data to load into the ImageData, in the format specified by ''format''.
imageData ImageData The new ImageData object.
imageData = love.image.newImageData( width, height, data )
width number The width of the ImageData.
height number The height of the ImageData.
data string The data to load into the ImageData (RGBA bytes, left to right and top to bottom).
imageData ImageData The new ImageData object.
imageData = love.image.newImageData( filename )
filename string The filename of the image file.
imageData ImageData The new ImageData object.
imageData = love.image.newImageData( filedata )
filedata FileData The encoded file data to decode into image data.
imageData ImageData The new ImageData object.