Nocare3/love2dapi_chunks huggingface dataset:
Canvas:newImageData
Generates ImageData from the contents of the Canvas.
data = Canvas:newImageData()
data ImageData The new ImageData made from the Canvas' contents.
data = Canvas:newImageData( slice, mipmap, x, y, width, height )
slice number The cubemap face index, array index, or depth layer for cubemap, array, or volume type Canvases, respectively. This argument is ignored for regular 2D canvases.
mipmap (1) number The mipmap index to use, for Canvases with mipmaps.
x number The x-axis of the top-left corner (in pixels) of the area within the Canvas to capture.
y number The y-axis of the top-left corner (in pixels) of the area within the Canvas to capture.
width number The width in pixels of the area within the Canvas to capture.
height number The height in pixels of the area within the Canvas to capture.
data ImageData The new ImageData made from the Canvas' contents.
Canvas:renderTo
Render to the Canvas using a function.

This is a shortcut to love.graphics.setCanvas:

canvas:renderTo( func )

is the same as

love.graphics.setCanvas( canvas )

func()

love.graphics.setCanvas()
Canvas:renderTo( func, ... )
func function A function performing drawing operations.
... any Additional arguments to call the function with.
Font:getAscent
Gets the ascent of the Font.

The ascent spans the distance between the baseline and the top of the glyph that reaches farthest from the baseline.
ascent = Font:getAscent()
ascent number The ascent of the Font in pixels.
Font:getBaseline
Gets the baseline of the Font.

Most scripts share the notion of a baseline: an imaginary horizontal line on which characters rest. In some scripts, parts of glyphs lie below the baseline.
baseline = Font:getBaseline()
baseline number The baseline of the Font in pixels.
Font:getDPIScale
Gets the DPI scale factor of the Font.

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

The font size of TrueType fonts is scaled internally by the font's specified DPI scale factor. By default, LÖVE uses the screen's DPI scale factor when creating TrueType fonts.
dpiscale = Font:getDPIScale()
dpiscale number The DPI scale factor of the Font.
Font:getDescent
Gets the descent of the Font.

The descent spans the distance between the baseline and the lowest descending glyph in a typeface.
descent = Font:getDescent()
descent number The descent of the Font in pixels.
Font:getFilter
Gets the filter mode for a font.
min, mag, anisotropy = Font:getFilter()
min FilterMode Filter mode used when minifying the font.
mag FilterMode Filter mode used when magnifying the font.
anisotropy number Maximum amount of anisotropic filtering used.
Font:getHeight
Gets the height of the Font.

The height of the font is the size including any spacing; the height which it will need.
height = Font:getHeight()
height number The height of the Font in pixels.
Font:getKerning
Gets the kerning between two characters in the Font.

Kerning is normally handled automatically in love.graphics.print, Text objects, Font:getWidth, Font:getWrap, etc. This function is useful when stitching text together manually.
kerning = Font:getKerning( leftchar, rightchar )
leftchar string The left character.
rightchar string The right character.
kerning number The kerning amount to add to the spacing between the two characters. May be negative.
kerning = Font:getKerning( leftglyph, rightglyph )
leftglyph number The unicode number for the left glyph.
rightglyph number The unicode number for the right glyph.
kerning number The kerning amount to add to the spacing between the two characters. May be negative.
Font:getLineHeight
Gets the line height.

This will be the value previously set by Font:setLineHeight, or 1.0 by default.
height = Font:getLineHeight()
height number The current line height.
Font:getWidth
Determines the maximum width (accounting for newlines) taken by the given string.
width = Font:getWidth( text )
text string A string.
width number The width of the text.
Font:getWrap
Gets formatting information for text, given a wrap limit.

This function accounts for newlines correctly (i.e. '\n').
width, wrappedtext = Font:getWrap( text, wraplimit )
text string The text that will be wrapped.
wraplimit number The maximum width in pixels of each line that ''text'' is allowed before wrapping.
width number The maximum width of the wrapped text.
wrappedtext table A sequence containing each line of text that was wrapped.
Font:hasGlyphs
Gets whether the Font can render a character or string.
hasglyph = Font:hasGlyphs( text )
text string A UTF-8 encoded unicode string.
hasglyph boolean Whether the font can render all the UTF-8 characters in the string.
hasglyph = Font:hasGlyphs( character1, character2 )
character1 string A unicode character.
character2 string Another unicode character.
hasglyph boolean Whether the font can render all the glyphs represented by the characters.
hasglyph = Font:hasGlyphs( codepoint1, codepoint2 )
codepoint1 number A unicode codepoint number.
codepoint2 number Another unicode codepoint number.
hasglyph boolean Whether the font can render all the glyphs represented by the codepoint numbers.
Font:setFallbacks
Sets the fallback fonts. When the Font doesn't contain a glyph, it will substitute the glyph from the next subsequent fallback Fonts. This is akin to setting a 'font stack' in Cascading Style Sheets (CSS).
Font:setFallbacks( fallbackfont1, ... )
fallbackfont1 Font The first fallback Font to use.
... Font Additional fallback Fonts.
Font:setFilter
Sets the filter mode for a font.
Font:setFilter( min, mag, anisotropy )
min FilterMode How to scale a font down.
mag FilterMode How to scale a font up.
anisotropy (1) number Maximum amount of anisotropic filtering used.
Font:setLineHeight
Sets the line height.

When rendering the font in lines the actual height will be determined by the line height multiplied by the height of the font. The default is 1.0.
Font:setLineHeight( height )
height number The new line height.
Image:isCompressed
Gets whether the Image was created from CompressedData.

Compressed images take up less space in VRAM, and drawing a compressed image will generally be more efficient than drawing one created from raw pixel data.
compressed = Image:isCompressed()
compressed boolean Whether the Image is stored as a compressed texture on the GPU.
Image:isFormatLinear
Gets whether the Image was created with the linear (non-gamma corrected) flag set to true.

This method always returns false when gamma-correct rendering is not enabled.
linear = Image:isFormatLinear()
linear boolean Whether the Image's internal pixel format is linear (not gamma corrected), when gamma-correct rendering is enabled.
Image:replacePixels
Replace the contents of an Image.
Image:replacePixels( data, slice, mipmap, x, y, reloadmipmaps )
data ImageData The new ImageData to replace the contents with.
slice (1) number Which cubemap face, array index, or volume layer to replace, if applicable.
mipmap (1) number The mimap level to replace, if the Image has mipmaps.
x (0) number The x-offset in pixels from the top-left of the image to replace. The given ImageData's width plus this value must not be greater than the pixel width of the Image's specified mipmap level.
y (0) number The y-offset in pixels from the top-left of the image to replace. The given ImageData's height plus this value must not be greater than the pixel height of the Image's specified mipmap level.
reloadmipmaps (false) boolean Whether to generate new mipmaps after replacing the Image's pixels. True by default if the Image was created with automatically generated mipmaps, false by default otherwise.
Mesh:attachAttribute
Attaches a vertex attribute from a different Mesh onto this Mesh, for use when drawing. This can be used to share vertex attribute data between several different Meshes.
Mesh:attachAttribute( name, mesh )
name string The name of the vertex attribute to attach.
mesh Mesh The Mesh to get the vertex attribute from.
Mesh:attachAttribute( name, mesh, step, attachname )
name string The name of the vertex attribute to attach.
mesh Mesh The Mesh to get the vertex attribute from.
step ('pervertex') VertexAttributeStep Whether the attribute will be per-vertex or per-instance when the mesh is drawn.
attachname (name) string The name of the attribute to use in shader code. Defaults to the name of the attribute in the given mesh. Can be used to use a different name for this attribute when rendering.
Mesh:detachAttribute
Removes a previously attached vertex attribute from this Mesh.
success = Mesh:detachAttribute( name )
name string The name of the attached vertex attribute to detach.
success boolean Whether the attribute was successfully detached.
Mesh:flush
Immediately sends all modified vertex data in the Mesh to the graphics card.

Normally it isn't necessary to call this method as love.graphics.draw(mesh, ...) will do it automatically if needed, but explicitly using **Mesh:flush** gives more control over when the work happens.

If this method is used, it generally shouldn't be called more than once (at most) between love.graphics.draw(mesh, ...) calls.
Mesh:flush()
Mesh:getDrawMode
Gets the mode used when drawing the Mesh.
mode = Mesh:getDrawMode()
mode MeshDrawMode The mode used when drawing the Mesh.
Mesh:getDrawRange
Gets the range of vertices used when drawing the Mesh.
min, max = Mesh:getDrawRange()
min number The index of the first vertex used when drawing, or the index of the first value in the vertex map used if one is set for this Mesh.
max number The index of the last vertex used when drawing, or the index of the last value in the vertex map used if one is set for this Mesh.
Mesh:getTexture
Gets the texture (Image or Canvas) used when drawing the Mesh.
texture = Mesh:getTexture()
texture Texture The Image or Canvas to texture the Mesh with when drawing, or nil if none is set.
Mesh:getVertex
Gets the properties of a vertex in the Mesh.

In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
attributecomponent, ... = Mesh:getVertex( index )
index number The one-based index of the vertex you want to retrieve the information for.
attributecomponent number The first component of the first vertex attribute in the specified vertex.
... number Additional components of all vertex attributes in the specified vertex.
x, y, u, v, r, g, b, a = Mesh:getVertex( index )
index number The index of the vertex you want to retrieve the information for.
x number The position of the vertex on the x-axis.
y number The position of the vertex on the y-axis.
u number The horizontal component of the texture coordinate.
v number The vertical component of the texture coordinate.
r number The red component of the vertex's color.
g number The green component of the vertex's color.
b number The blue component of the vertex's color.
a number The alpha component of the vertex's color.
Mesh:getVertexAttribute
Gets the properties of a specific attribute within a vertex in the Mesh.

Meshes without a custom vertex format specified in love.graphics.newMesh have position as their first attribute, texture coordinates as their second attribute, and color as their third attribute.
value1, value2, ... = Mesh:getVertexAttribute( vertexindex, attributeindex )
vertexindex number The index of the the vertex you want to retrieve the attribute for (one-based).
attributeindex number The index of the attribute within the vertex to be retrieved (one-based).
value1 number The value of the first component of the attribute.
value2 number The value of the second component of the attribute.
... number Any additional vertex attribute components.
Mesh:getVertexCount
Gets the total number of vertices in the Mesh.
count = Mesh:getVertexCount()
count number The total number of vertices in the mesh.
Mesh:getVertexFormat
Gets the vertex format that the Mesh was created with.
format = Mesh:getVertexFormat()
format table The vertex format of the Mesh, which is a table containing tables for each vertex attribute the Mesh was created with, in the form of {attribute, ...}.
format.attribute table A table containing the attribute's name, it's data type, and the number of components in the attribute, in the form of {name, datatype, components}.
format.... table Additional vertex attributes in the Mesh.
Mesh:getVertexMap
Gets the vertex map for the Mesh. The vertex map describes the order in which the vertices are used when the Mesh is drawn. The vertices, vertex map, and mesh draw mode work together to determine what exactly is displayed on the screen.

If no vertex map has been set previously via Mesh:setVertexMap, then this function will return nil in LÖVE 0.10.0+, or an empty table in 0.9.2 and older.
map = Mesh:getVertexMap()
map table A table containing the list of vertex indices used when drawing.
Mesh:isAttributeEnabled
Gets whether a specific vertex attribute in the Mesh is enabled. Vertex data from disabled attributes is not used when drawing the Mesh.
enabled = Mesh:isAttributeEnabled( name )
name string The name of the vertex attribute to be checked.
enabled boolean Whether the vertex attribute is used when drawing this Mesh.
Mesh:setAttributeEnabled
Enables or disables a specific vertex attribute in the Mesh. Vertex data from disabled attributes is not used when drawing the Mesh.
Mesh:setAttributeEnabled( name, enable )
name string The name of the vertex attribute to enable or disable.
enable boolean Whether the vertex attribute is used when drawing this Mesh.
Mesh:setDrawMode
Sets the mode used when drawing the Mesh.
Mesh:setDrawMode( mode )
mode MeshDrawMode The mode to use when drawing the Mesh.
Mesh:setDrawRange
Restricts the drawn vertices of the Mesh to a subset of the total.
Mesh:setDrawRange( start, count )
start number The index of the first vertex to use when drawing, or the index of the first value in the vertex map to use if one is set for this Mesh.
count number The number of vertices to use when drawing, or number of values in the vertex map to use if one is set for this Mesh.
Mesh:setDrawRange()
Mesh:setTexture
Sets the texture (Image or Canvas) used when drawing the Mesh.
Mesh:setTexture( texture )
texture Texture The Image or Canvas to texture the Mesh with when drawing.
Mesh:setTexture()
Mesh:setVertex
Sets the properties of a vertex in the Mesh.

In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.
Mesh:setVertex( index, attributecomponent, ... )
index number The index of the the vertex you want to modify (one-based).
attributecomponent number The first component of the first vertex attribute in the specified vertex.
... number Additional components of all vertex attributes in the specified vertex.
Mesh:setVertex( index, vertex )
index number The index of the the vertex you want to modify (one-based).
vertex table A table with vertex information, in the form of {attributecomponent, ...}.
vertex.attributecomponent number The first component of the first vertex attribute in the specified vertex.
vertex.... number Additional components of all vertex attributes in the specified vertex.
Mesh:setVertex( index, x, y, u, v, r, g, b, a )
index number The index of the the vertex you want to modify (one-based).
x number The position of the vertex on the x-axis.
y number The position of the vertex on the y-axis.
u number The horizontal component of the texture coordinate.
v number The vertical component of the texture coordinate.
r (1) number The red component of the vertex's color.
g (1) number The green component of the vertex's color.
b (1) number The blue component of the vertex's color.
a (1) number The alpha component of the vertex's color.
Mesh:setVertex( index, vertex )
index number The index of the the vertex you want to modify (one-based).
vertex table A table with vertex information.
vertex.1 number The position of the vertex on the x-axis.
vertex.2 number The position of the vertex on the y-axis.
vertex.3 number The u texture coordinate. Texture coordinates are normally in the range of 1, but can be greater or less (see WrapMode.)
vertex.4 number The v texture coordinate. Texture coordinates are normally in the range of 1, but can be greater or less (see WrapMode.)
vertex.5 (1) number The red color component.
vertex.6 (1) number The green color component.
vertex.7 (1) number The blue color component.
vertex.8 (1) number The alpha color component.
Mesh:setVertexAttribute
Sets the properties of a specific attribute within a vertex in the Mesh.

Meshes without a custom vertex format specified in love.graphics.newMesh have position as their first attribute, texture coordinates as their second attribute, and color as their third attribute.
Mesh:setVertexAttribute( vertexindex, attributeindex, value1, value2, ... )
vertexindex number The index of the the vertex to be modified (one-based).
attributeindex number The index of the attribute within the vertex to be modified (one-based).
value1 number The new value for the first component of the attribute.
value2 number The new value for the second component of the attribute.
... number Any additional vertex attribute components.
Mesh:setVertexMap
Sets the vertex map for the Mesh. The vertex map describes the order in which the vertices are used when the Mesh is drawn. The vertices, vertex map, and mesh draw mode work together to determine what exactly is displayed on the screen.

The vertex map allows you to re-order or reuse vertices when drawing without changing the actual vertex parameters or duplicating vertices. It is especially useful when combined with different Mesh Draw Modes.
Mesh:setVertexMap( map )
map table A table containing a list of vertex indices to use when drawing. Values must be in the range of Mesh:getVertexCount().
Mesh:setVertexMap( vi1, vi2, vi3 )
vi1 number The index of the first vertex to use when drawing. Must be in the range of Mesh:getVertexCount().
vi2 number The index of the second vertex to use when drawing.
vi3 number The index of the third vertex to use when drawing.
Mesh:setVertexMap( data, datatype )
data Data Array of vertex indices to use when drawing. Values must be in the range of Mesh:getVertexCount()-1
datatype IndexDataType Datatype of the vertex indices array above.
Mesh:setVertices
Replaces a range of vertices in the Mesh with new ones. The total number of vertices in a Mesh cannot be changed after it has been created. This is often more efficient than calling Mesh:setVertex in a loop.
Mesh:setVertices( vertices, startvertex, count )
vertices table The table filled with vertex information tables for each vertex, in the form of {vertex, ...} where each vertex is a table in the form of {attributecomponent, ...}.
vertices.attributecomponent number The first component of the first vertex attribute in the vertex.
vertices.... number Additional components of all vertex attributes in the vertex.
startvertex (1) number The index of the first vertex to replace.
count (all) number Amount of vertices to replace.
Mesh:setVertices( data, startvertex )
data Data A Data object to copy from. The contents of the Data must match the layout of this Mesh's vertex format.
startvertex (1) number The index of the first vertex to replace.
Mesh:setVertices( vertices )
vertices table The table filled with vertex information tables for each vertex as follows:
vertices.1 number The position of the vertex on the x-axis.
vertices.2 number The position of the vertex on the y-axis.
vertices.3 number The horizontal component of the texture coordinate. Texture coordinates are normally in the range of 1, but can be greater or less (see WrapMode).
vertices.4 number The vertical component of the texture coordinate. Texture coordinates are normally in the range of 1, but can be greater or less (see WrapMode).
vertices.5 (1) number The red color component.
vertices.6 (1) number The green color component.
vertices.7 (1) number The blue color component.
vertices.8 (1) number The alpha color component.
ParticleSystem:clone
Creates an identical copy of the ParticleSystem in the stopped state.
particlesystem = ParticleSystem:clone()
particlesystem ParticleSystem The new identical copy of this ParticleSystem.
ParticleSystem:emit
Emits a burst of particles from the particle emitter.
ParticleSystem:emit( numparticles )
numparticles number The amount of particles to emit. The number of emitted particles will be truncated if the particle system's max buffer size is reached.
ParticleSystem:getBufferSize
Gets the maximum number of particles the ParticleSystem can have at once.
size = ParticleSystem:getBufferSize()
size number The maximum number of particles.
ParticleSystem:getColors
Gets the series of colors applied to the particle sprite.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
r1, g1, b1, a1, r2, g2, b2, a2, r8, g8, b8, a8 = ParticleSystem:getColors()
r1 number First color, red component (0-1).
g1 number First color, green component (0-1).
b1 number First color, blue component (0-1).
a1 number First color, alpha component (0-1).
r2 number Second color, red component (0-1).
g2 number Second color, green component (0-1).
b2 number Second color, blue component (0-1).
a2 number Second color, alpha component (0-1).
r8 number Eighth color, red component (0-1).
g8 number Eighth color, green component (0-1).
b8 number Eighth color, blue component (0-1).
a8 number Eighth color, alpha component (0-1).
ParticleSystem:getCount
Gets the number of particles that are currently in the system.
count = ParticleSystem:getCount()
count number The current number of live particles.
ParticleSystem:getDirection
Gets the direction of the particle emitter (in radians).
direction = ParticleSystem:getDirection()
direction number The direction of the emitter (radians).
ParticleSystem:getEmissionArea
Gets the area-based spawn parameters for the particles.
distribution, dx, dy, angle, directionRelativeToCenter = ParticleSystem:getEmissionArea()
distribution AreaSpreadDistribution The type of distribution for new particles.
dx number The maximum spawn distance from the emitter along the x-axis for uniform distribution, or the standard deviation along the x-axis for normal distribution.
dy number The maximum spawn distance from the emitter along the y-axis for uniform distribution, or the standard deviation along the y-axis for normal distribution.
angle number The angle in radians of the emission area.
directionRelativeToCenter boolean True if newly spawned particles will be oriented relative to the center of the emission area, false otherwise.
ParticleSystem:getEmissionRate
Gets the amount of particles emitted per second.
rate = ParticleSystem:getEmissionRate()
rate number The amount of particles per second.
ParticleSystem:getEmitterLifetime
Gets how long the particle system will emit particles (if -1 then it emits particles forever).
life = ParticleSystem:getEmitterLifetime()
life number The lifetime of the emitter (in seconds).
ParticleSystem:getInsertMode
Gets the mode used when the ParticleSystem adds new particles.
mode = ParticleSystem:getInsertMode()
mode ParticleInsertMode The mode used when the ParticleSystem adds new particles.
ParticleSystem:getLinearAcceleration
Gets the linear acceleration (acceleration along the x and y axes) for particles.

Every particle created will accelerate along the x and y axes between xmin,ymin and xmax,ymax.
xmin, ymin, xmax, ymax = ParticleSystem:getLinearAcceleration()
xmin number The minimum acceleration along the x axis.
ymin number The minimum acceleration along the y axis.
xmax number The maximum acceleration along the x axis.
ymax number The maximum acceleration along the y axis.
ParticleSystem:getLinearDamping
Gets the amount of linear damping (constant deceleration) for particles.
min, max = ParticleSystem:getLinearDamping()
min number The minimum amount of linear damping applied to particles.
max number The maximum amount of linear damping applied to particles.
ParticleSystem:getOffset
Gets the particle image's draw offset.
ox, oy = ParticleSystem:getOffset()
ox number The x coordinate of the particle image's draw offset.
oy number The y coordinate of the particle image's draw offset.