Nocare3/love2dapi_chunks huggingface dataset:
love.graphics.newText
Creates a new drawable Text object.
text = love.graphics.newText( font, textstring )
font Font The font to use for the text.
textstring (nil) string The initial string of text that the new Text object will contain. May be nil.
text Text The new drawable Text object.
text = love.graphics.newText( font, coloredtext )
font Font The font to use for the text.
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.... Variant Additional colors and strings.
text Text The new drawable Text object.
love.graphics.newVideo
Creates a new drawable Video. Currently only Ogg Theora video files are supported.
video = love.graphics.newVideo( filename )
filename string The file path to the Ogg Theora video file.
video Video A new Video.
video = love.graphics.newVideo( videostream )
videostream VideoStream A video stream object.
video Video A new Video.
video = love.graphics.newVideo( filename, settings )
filename string The file path to the Ogg Theora video file (or VideoStream).
settings table A table containing the following fields:
settings.audio (false) boolean Whether to try to load the video's audio into an audio Source. If not explicitly set to true or false, it will try without causing an error if the video has no audio.
settings.dpiscale (love.graphics.getDPIScale()) number The DPI scale factor of the video.
video Video A new Video.
video = love.graphics.newVideo( filename, loadaudio )
filename string The file path to the Ogg Theora video file.
loadaudio (nil) boolean Whether to try to load the video's audio into an audio Source. If not explicitly set to true or false, it will try without causing an error if the video has no audio.
video Video A new Video.
video = love.graphics.newVideo( videostream, loadaudio )
videostream VideoStream A video stream object.
loadaudio (nil) boolean Whether to try to load the video's audio into an audio Source. If not explicitly set to true or false, it will try without causing an error if the video has no audio.
video Video A new Video.
love.graphics.newVolumeImage
Creates a new volume (3D) Image.

Volume images are 3D textures with width, height, and depth. They can't be rendered directly, they can only be used in Shader code (and sent to the shader via Shader:send).

To use a volume image in a Shader, it must be declared as a VolumeImage or sampler3D type (instead of Image or sampler2D). The Texel(VolumeImage image, vec3 texcoords) shader function must be used to get pixel colors from the volume image. The vec3 argument is a normalized texture coordinate with the z component representing the depth to sample at (ranging from 1).

Volume images are typically used as lookup tables in shaders for color grading, for example, because sampling using a texture coordinate that is partway in between two pixels can interpolate across all 3 dimensions in the volume image, resulting in a smooth gradient even when a small-sized volume image is used as the lookup table.

Array images are a much better choice than volume images for storing multiple different sprites in a single array image for directly drawing them.
image = love.graphics.newVolumeImage( layers, settings )
layers table A table containing filepaths to images (or File, FileData, ImageData, or CompressedImageData objects), in an array. A table of tables can also be given, where each sub-table represents a single mipmap level and contains all layers for that mipmap.
settings (nil) table Optional table of settings to configure the volume image, containing the following fields:
settings.mipmaps (false) boolean True to make the image use mipmaps, false to disable them. Mipmaps will be automatically generated if the image isn't a compressed texture format.
settings.linear (false) boolean True to treat the image's pixels as linear instead of sRGB, when gamma correct rendering is enabled. Most images are authored as sRGB.
image Image A volume Image object.
love.graphics.origin
Resets the current coordinate transformation.

This function is always used to reverse any previous calls to love.graphics.rotate, love.graphics.scale, love.graphics.shear or love.graphics.translate. It returns the current transformation state to its defaults.
love.graphics.origin()
love.graphics.points
Draws one or more points.
love.graphics.points( x, y, ... )
x number The position of the first point on the x-axis.
y number The position of the first point on the y-axis.
... number The x and y coordinates of additional points.
love.graphics.points( points )
points table A table containing multiple point positions, in the form of {x, y, ...}.
love.graphics.points( points )
points table A table containing multiple individually colored points, in the form of {point, ...}.
points.point table A table containing the position and color of the first point, in the form of {x, y, r, g, b, a}. The color components are optional.
points.... table Additional tables containing the position and color of more points, in the form of {x, y, r, g, b, a}. The color components are optional.
love.graphics.polygon
Draw a polygon.

Following the mode argument, this function can accept multiple numeric arguments or a single table of numeric arguments. In either case the arguments are interpreted as alternating x and y coordinates of the polygon's vertices.
love.graphics.polygon( mode, ... )
mode DrawMode How to draw the polygon.
... number The vertices of the polygon.
love.graphics.polygon( mode, vertices )
mode DrawMode How to draw the polygon.
vertices table The vertices of the polygon as a table.
love.graphics.pop
Pops the current coordinate transformation from the transformation stack.

This function is always used to reverse a previous push operation. It returns the current transformation state to what it was before the last preceding push.
love.graphics.pop()
love.graphics.present
Displays the results of drawing operations on the screen.

This function is used when writing your own love.run function. It presents all the results of your drawing operations on the screen. See the example in love.run for a typical use of this function.
love.graphics.present()
love.graphics.push
Copies and pushes the current coordinate transformation to the transformation stack.

This function is always used to prepare for a corresponding pop operation later. It stores the current coordinate transformation state into the transformation stack and keeps it active. Later changes to the transformation can be undone by using the pop operation, which returns the coordinate transform to the state it was in before calling push.
love.graphics.push()
love.graphics.push( stack )
stack StackType The type of stack to push (e.g. just transformation state, or all love.graphics state).
love.graphics.rectangle
Draws a rectangle.
love.graphics.rectangle( mode, x, y, width, height )
mode DrawMode How to draw the rectangle.
x number The position of top-left corner along the x-axis.
y number The position of top-left corner along the y-axis.
width number Width of the rectangle.
height number Height of the rectangle.
love.graphics.rectangle( mode, x, y, width, height, rx, ry, segments )
mode DrawMode How to draw the rectangle.
x number The position of top-left corner along the x-axis.
y number The position of top-left corner along the y-axis.
width number Width of the rectangle.
height number Height of the rectangle.
rx number The x-axis radius of each round corner. Cannot be greater than half the rectangle's width.
ry (rx) number The y-axis radius of each round corner. Cannot be greater than half the rectangle's height.
segments (nil) number The number of segments used for drawing the round corners. A default amount will be chosen if no number is given.
love.graphics.replaceTransform
Replaces the current coordinate transformation with the given Transform object.
love.graphics.replaceTransform( transform )
transform Transform The Transform object to replace the current graphics coordinate transform with.
love.graphics.reset
Resets the current graphics settings.

Calling reset makes the current drawing color white, the current background color black, disables any active color component masks, disables wireframe mode and resets the current graphics transformation to the origin. It also sets both the point and line drawing modes to smooth and their sizes to 1.0.
love.graphics.reset()
love.graphics.rotate
Rotates the coordinate system in two dimensions.

Calling this function affects all future drawing operations by rotating the coordinate system around the origin by the given amount of radians. This change lasts until love.draw() exits.
love.graphics.rotate( angle )
angle number The amount to rotate the coordinate system in radians.
love.graphics.scale
Scales the coordinate system in two dimensions.

By default the coordinate system in LÖVE corresponds to the display pixels in horizontal and vertical directions one-to-one, and the x-axis increases towards the right while the y-axis increases downwards. Scaling the coordinate system changes this relation.

After scaling by sx and sy, all coordinates are treated as if they were multiplied by sx and sy. Every result of a drawing operation is also correspondingly scaled, so scaling by (2, 2) for example would mean making everything twice as large in both x- and y-directions. Scaling by a negative value flips the coordinate system in the corresponding direction, which also means everything will be drawn flipped or upside down, or both. Scaling by zero is not a useful operation.

Scale and translate are not commutative operations, therefore, calling them in different orders will change the outcome.

Scaling lasts until love.draw() exits.
love.graphics.scale( sx, sy )
sx number The scaling in the direction of the x-axis.
sy (sx) number The scaling in the direction of the y-axis. If omitted, it defaults to same as parameter sx.
love.graphics.setBackgroundColor
Sets the background color.
love.graphics.setBackgroundColor( red, green, blue, alpha )
red number The red component (0-1).
green number The green component (0-1).
blue number The blue component (0-1).
alpha (1) number The alpha component (0-1).
love.graphics.setBackgroundColor( rgba )
rgba table A numerical indexed table with the red, green, blue and alpha values as numbers. The alpha is optional and defaults to 1 if it is left out.
love.graphics.setBlendMode
Sets the blending mode.
love.graphics.setBlendMode( mode )
mode BlendMode The blend mode to use.
love.graphics.setBlendMode( mode, alphamode )
mode BlendMode The blend mode to use.
alphamode ('alphamultiply') BlendAlphaMode What to do with the alpha of drawn objects when blending.
love.graphics.setCanvas
Captures drawing operations to a Canvas.
love.graphics.setCanvas( canvas, mipmap )
canvas Canvas The new target.
mipmap (1) number The mipmap level to render to, for Canvases with mipmaps.
love.graphics.setCanvas()
love.graphics.setCanvas( canvas1, canvas2, ... )
canvas1 Canvas The first render target.
canvas2 Canvas The second render target.
... Canvas More canvases.
love.graphics.setCanvas( canvas, slice, mipmap )
canvas Canvas The new render target.
slice number For cubemaps this is the cube face index to render to (between 1 and 6). For Array textures this is the array layer. For volume textures this is the depth slice. 2D canvases should use a value of 1.
mipmap (1) number The mipmap level to render to, for Canvases with mipmaps.
love.graphics.setCanvas( setup )
setup table A table specifying the active Canvas(es), their mipmap levels and active layers if applicable, and whether to use a stencil and/or depth buffer.
setup.1 RenderTargetSetup The Canvas to render to.
setup.2 (nil) RenderTargetSetup An additional Canvas to render to, if multiple simultaneous render targets are wanted.
setup.... RenderTargetSetup Additional Canvases to render to, if multiple simultaneous render targets are wanted.
setup.stencil (false) boolean Whether an internally managed stencil buffer should be used, if the depthstencil field isn't set.
setup.depth (false) boolean Whether an internally managed depth buffer should be used, if the depthstencil field isn't set.
setup.depthstencil (nil) RenderTargetSetup An optional custom depth/stencil formatted Canvas to use for the depth and/or stencil buffer.
love.graphics.setColor
Sets the color used for drawing.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
love.graphics.setColor( red, green, blue, alpha )
red number The amount of red.
green number The amount of green.
blue number The amount of blue.
alpha (1) number The amount of alpha. The alpha value will be applied to all subsequent draw operations, even the drawing of an image.
love.graphics.setColor( rgba )
rgba table A numerical indexed table with the red, green, blue and alpha values as numbers. The alpha is optional and defaults to 1 if it is left out.
love.graphics.setColorMask
Sets the color mask. Enables or disables specific color components when rendering and clearing the screen. For example, if '''red''' is set to '''false''', no further changes will be made to the red component of any pixels.
love.graphics.setColorMask( red, green, blue, alpha )
red boolean Render red component.
green boolean Render green component.
blue boolean Render blue component.
alpha boolean Render alpha component.
love.graphics.setColorMask()
love.graphics.setDefaultFilter
Sets the default scaling filters used with Images, Canvases, and Fonts.
love.graphics.setDefaultFilter( min, mag, anisotropy )
min FilterMode Filter mode used when scaling the image down.
mag (min) FilterMode Filter mode used when scaling the image up.
anisotropy (1) number Maximum amount of Anisotropic Filtering used.
love.graphics.setDepthMode
Configures depth testing and writing to the depth buffer.

This is low-level functionality designed for use with custom vertex shaders and Meshes with custom vertex attributes. No higher level APIs are provided to set the depth of 2D graphics such as shapes, lines, and Images.
love.graphics.setDepthMode( comparemode, write )
comparemode CompareMode Depth comparison mode used for depth testing.
write boolean Whether to write update / write values to the depth buffer when rendering.
love.graphics.setDepthMode()
love.graphics.setFont
Set an already-loaded Font as the current font or create and load a new one from the file and size.

It's recommended that Font objects are created with love.graphics.newFont in the loading stage and then passed to this function in the drawing stage.
love.graphics.setFont( font )
font Font The Font object to use.
love.graphics.setFrontFaceWinding
Sets whether triangles with clockwise- or counterclockwise-ordered vertices are considered front-facing.

This is designed for use in combination with Mesh face culling. Other love.graphics shapes, lines, and sprites are not guaranteed to have a specific winding order to their internal vertices.
love.graphics.setFrontFaceWinding( winding )
winding VertexWinding The winding mode to use. The default winding is counterclockwise ('ccw').
love.graphics.setLineJoin
Sets the line join style. See LineJoin for the possible options.
love.graphics.setLineJoin( join )
join LineJoin The LineJoin to use.
love.graphics.setLineStyle
Sets the line style.
love.graphics.setLineStyle( style )
style LineStyle The LineStyle to use. Line styles include smooth and rough.
love.graphics.setLineWidth
Sets the line width.
love.graphics.setLineWidth( width )
width number The width of the line.
love.graphics.setMeshCullMode
Sets whether back-facing triangles in a Mesh are culled.

This is designed for use with low level custom hardware-accelerated 3D rendering via custom vertex attributes on Meshes, custom vertex shaders, and depth testing with a depth buffer.

By default, both front- and back-facing triangles in Meshes are rendered.
love.graphics.setMeshCullMode( mode )
mode CullMode The Mesh face culling mode to use (whether to render everything, cull back-facing triangles, or cull front-facing triangles).
love.graphics.setNewFont
Creates and sets a new Font.
font = love.graphics.setNewFont( size )
size (12) number The size of the font.
font Font The new font.
font = love.graphics.setNewFont( filename, size )
filename string The path and name of the file with the font.
size (12) number The size of the font.
font Font The new font.
font = love.graphics.setNewFont( file, size )
file File A File with the font.
size (12) number The size of the font.
font Font The new font.
font = love.graphics.setNewFont( data, size )
data Data A Data with the font.
size (12) number The size of the font.
font Font The new font.
font = love.graphics.setNewFont( rasterizer )
rasterizer Rasterizer A rasterizer.
font Font The new font.
love.graphics.setPointSize
Sets the point size.
love.graphics.setPointSize( size )
size number The new point size.
love.graphics.setScissor
Sets or disables scissor.

The scissor limits the drawing area to a specified rectangle. This affects all graphics calls, including love.graphics.clear.

The dimensions of the scissor is unaffected by graphical transformations (translate, scale, ...).
love.graphics.setScissor( x, y, width, height )
x number x coordinate of upper left corner.
y number y coordinate of upper left corner.
width number width of clipping rectangle.
height number height of clipping rectangle.
love.graphics.setScissor()
love.graphics.setShader
Sets or resets a Shader as the current pixel effect or vertex shaders. All drawing operations until the next ''love.graphics.setShader'' will be drawn using the Shader object specified.
love.graphics.setShader( shader )
shader Shader The new shader.
love.graphics.setShader()
love.graphics.setStencilTest
Configures or disables stencil testing.

When stencil testing is enabled, the geometry of everything that is drawn afterward will be clipped / stencilled out based on a comparison between the arguments of this function and the stencil value of each pixel that the geometry touches. The stencil values of pixels are affected via love.graphics.stencil.
love.graphics.setStencilTest( comparemode, comparevalue )
comparemode CompareMode The type of comparison to make for each pixel.
comparevalue number The value to use when comparing with the stencil value of each pixel. Must be between 0 and 255.
love.graphics.setStencilTest()
love.graphics.setWireframe
Sets whether wireframe lines will be used when drawing.
love.graphics.setWireframe( enable )
enable boolean True to enable wireframe mode when drawing, false to disable it.
love.graphics.shear
Shears the coordinate system.
love.graphics.shear( kx, ky )
kx number The shear factor on the x-axis.
ky number The shear factor on the y-axis.
love.graphics.stencil
Draws geometry as a stencil.

The geometry drawn by the supplied function sets invisible stencil values of pixels, instead of setting pixel colors. The stencil buffer (which contains those stencil values) can act like a mask / stencil - love.graphics.setStencilTest can be used afterward to determine how further rendering is affected by the stencil values in each pixel.

Stencil values are integers within the range of 255.
love.graphics.stencil( stencilfunction, action, value, keepvalues )
stencilfunction function Function which draws geometry. The stencil values of pixels, rather than the color of each pixel, will be affected by the geometry.
action ('replace') StencilAction How to modify any stencil values of pixels that are touched by what's drawn in the stencil function.
value (1) number The new stencil value to use for pixels if the 'replace' stencil action is used. Has no effect with other stencil actions. Must be between 0 and 255.
keepvalues (false) boolean True to preserve old stencil values of pixels, false to re-set every pixel's stencil value to 0 before executing the stencil function. love.graphics.clear will also re-set all stencil values.
love.graphics.transformPoint
Converts the given 2D position from global coordinates into screen-space.

This effectively applies the current graphics transformations to the given position. A similar Transform:transformPoint method exists for Transform objects.
screenX, screenY = love.graphics.transformPoint( globalX, globalY )
globalX number The x component of the position in global coordinates.
globalY number The y component of the position in global coordinates.
screenX number The x component of the position with graphics transformations applied.
screenY number The y component of the position with graphics transformations applied.
love.graphics.translate
Translates the coordinate system in two dimensions.

When this function is called with two numbers, dx, and dy, all the following drawing operations take effect as if their x and y coordinates were x+dx and y+dy.

Scale and translate are not commutative operations, therefore, calling them in different orders will change the outcome.

This change lasts until love.draw() exits or else a love.graphics.pop reverts to a previous love.graphics.push.

Translating using whole numbers will prevent tearing/blurring of images and fonts draw after translating.
love.graphics.translate( dx, dy )
dx number The translation relative to the x-axis.
dy number The translation relative to the y-axis.
love.graphics.validateShader
Validates shader code. Check if specified shader code does not contain any errors.
status, message = love.graphics.validateShader( gles, code )
gles boolean Validate code as GLSL ES shader.
code string The pixel shader or vertex shader code, or a filename pointing to a file with the code.
status boolean true if specified shader code doesn't contain any errors. false otherwise.
message string Reason why shader code validation failed (or nil if validation succeded).
status, message = love.graphics.validateShader( gles, pixelcode, vertexcode )
gles boolean Validate code as GLSL ES shader.
pixelcode string The pixel shader code, or a filename pointing to a file with the code.
vertexcode string The vertex shader code, or a filename pointing to a file with the code.
status boolean true if specified shader code doesn't contain any errors. false otherwise.
message string Reason why shader code validation failed (or nil if validation succeded).
Canvas:generateMipmaps
Generates mipmaps for the Canvas, based on the contents of the highest-resolution mipmap level.

The Canvas must be created with mipmaps set to a MipmapMode other than 'none' for this function to work. It should only be called while the Canvas is not the active render target.

If the mipmap mode is set to 'auto', this function is automatically called inside love.graphics.setCanvas when switching from this Canvas to another Canvas or to the main screen.
Canvas:generateMipmaps()
Canvas:getMSAA
Gets the number of multisample antialiasing (MSAA) samples used when drawing to the Canvas.

This may be different than the number used as an argument to love.graphics.newCanvas if the system running LÖVE doesn't support that number.
samples = Canvas:getMSAA()
samples number The number of multisample antialiasing samples used by the canvas when drawing to it.
Canvas:getMipmapMode
Gets the MipmapMode this Canvas was created with.
mode = Canvas:getMipmapMode()
mode MipmapMode The mipmap mode this Canvas was created with.