Nocare3/love2dapi_chunks huggingface dataset:
love.graphics.getStats
Gets performance-related rendering statistics.
stats = love.graphics.getStats()
stats table A table with the following fields:
stats.drawcalls number The number of draw calls made so far during the current frame.
stats.canvasswitches number The number of times the active Canvas has been switched so far during the current frame.
stats.texturememory number The estimated total size in bytes of video memory used by all loaded Images, Canvases, and Fonts.
stats.images number The number of Image objects currently loaded.
stats.canvases number The number of Canvas objects currently loaded.
stats.fonts number The number of Font objects currently loaded.
stats.shaderswitches number The number of times the active Shader has been changed so far during the current frame.
stats.drawcallsbatched number The number of draw calls that were saved by LÖVE's automatic batching, since the start of the frame.
stats = love.graphics.getStats( stats )
stats table A table which will be filled in with the stat fields below.
stats table The table that was passed in above, now containing the following fields:
stats.drawcalls number The number of draw calls made so far during the current frame.
stats.canvasswitches number The number of times the active Canvas has been switched so far during the current frame.
stats.texturememory number The estimated total size in bytes of video memory used by all loaded Images, Canvases, and Fonts.
stats.images number The number of Image objects currently loaded.
stats.canvases number The number of Canvas objects currently loaded.
stats.fonts number The number of Font objects currently loaded.
stats.shaderswitches number The number of times the active Shader has been changed so far during the current frame.
stats.drawcallsbatched number The number of draw calls that were saved by LÖVE's automatic batching, since the start of the frame.
love.graphics.getStencilTest
Gets the current stencil test configuration.

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.

Each Canvas has its own per-pixel stencil values.
comparemode, comparevalue = love.graphics.getStencilTest()
comparemode CompareMode The type of comparison that is made for each pixel. Will be 'always' if stencil testing is disabled.
comparevalue number The value used when comparing with the stencil value of each pixel.
love.graphics.getSupported
Gets the optional graphics features and whether they're supported on the system.

Some older or low-end systems don't always support all graphics features.
features = love.graphics.getSupported()
features table A table containing GraphicsFeature keys, and boolean values indicating whether each feature is supported.
love.graphics.getSystemLimits
Gets the system-dependent maximum values for love.graphics features.
limits = love.graphics.getSystemLimits()
limits table A table containing GraphicsLimit keys, and number values.
love.graphics.getTextureTypes
Gets the available texture types, and whether each is supported.
texturetypes = love.graphics.getTextureTypes()
texturetypes table A table containing TextureTypes as keys, and a boolean indicating whether the type is supported as values. Not all systems support all types.
love.graphics.getWidth
Gets the width in pixels of the window.
width = love.graphics.getWidth()
width number The width of the window.
love.graphics.intersectScissor
Sets the scissor to the rectangle created by the intersection of the specified rectangle with the existing scissor. If no scissor is active yet, it behaves like love.graphics.setScissor.

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.intersectScissor( x, y, width, height )
x number The x-coordinate of the upper left corner of the rectangle to intersect with the existing scissor rectangle.
y number The y-coordinate of the upper left corner of the rectangle to intersect with the existing scissor rectangle.
width number The width of the rectangle to intersect with the existing scissor rectangle.
height number The height of the rectangle to intersect with the existing scissor rectangle.
love.graphics.inverseTransformPoint
Converts the given 2D position from screen-space into global coordinates.

This effectively applies the reverse of the current graphics transformations to the given position. A similar Transform:inverseTransformPoint method exists for Transform objects.
globalX, globalY = love.graphics.inverseTransformPoint( screenX, screenY )
screenX number The x component of the screen-space position.
screenY number The y component of the screen-space position.
globalX number The x component of the position in global coordinates.
globalY number The y component of the position in global coordinates.
love.graphics.isActive
Gets whether the graphics module is able to be used. If it is not active, love.graphics function and method calls will not work correctly and may cause the program to crash. The graphics module is inactive if a window is not open, or if the app is in the background on iOS. Typically the app's execution will be automatically paused by the system, in the latter case.
active = love.graphics.isActive()
active boolean Whether the graphics module is active and able to be used.
love.graphics.isGammaCorrect
Gets whether gamma-correct rendering is supported and enabled. It can be enabled by setting t.gammacorrect = true in love.conf.

Not all devices support gamma-correct rendering, in which case it will be automatically disabled and this function will return false. It is supported on desktop systems which have graphics cards that are capable of using OpenGL 3 / DirectX 10, and iOS devices that can use OpenGL ES 3.
gammacorrect = love.graphics.isGammaCorrect()
gammacorrect boolean True if gamma-correct rendering is supported and was enabled in love.conf, false otherwise.
love.graphics.isWireframe
Gets whether wireframe mode is used when drawing.
wireframe = love.graphics.isWireframe()
wireframe boolean True if wireframe lines are used when drawing, false if it's not.
love.graphics.line
Draws lines between points.
love.graphics.line( x1, y1, x2, y2, ... )
x1 number The position of first point on the x-axis.
y1 number The position of first point on the y-axis.
x2 number The position of second point on the x-axis.
y2 number The position of second point on the y-axis.
... number You can continue passing point positions to draw a polyline.
love.graphics.line( points )
points table A table of point positions, as described above.
love.graphics.newArrayImage
Creates a new array Image.

An array image / array texture is a single object which contains multiple 'layers' or 'slices' of 2D sub-images. It can be thought of similarly to a texture atlas or sprite sheet, but it doesn't suffer from the same tile / quad bleeding artifacts that texture atlases do – although every sub-image must have the same dimensions.

A specific layer of an array image can be drawn with love.graphics.drawLayer / SpriteBatch:addLayer, or with the Quad variant of love.graphics.draw and Quad:setLayer, or via a custom Shader.

To use an array image in a Shader, it must be declared as a ArrayImage or sampler2DArray type (instead of Image or sampler2D). The Texel(ArrayImage image, vec3 texturecoord) shader function must be used to get pixel colors from a slice of the array image. The vec3 argument contains the texture coordinate in the first two components, and the 0-based slice index in the third component.
image = love.graphics.newArrayImage( slices, settings )
slices table A table containing filepaths to images (or File, FileData, ImageData, or CompressedImageData objects), in an array. Each sub-image must have the same dimensions. A table of tables can also be given, where each sub-table contains all mipmap levels for the slice index of that sub-table.
settings (nil) table Optional table of settings to configure the array 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.
settings.dpiscale (1) number The DPI scale to use when drawing the array image and calling getWidth/getHeight.
image Image An Array Image object.
love.graphics.newCanvas
Creates a new Canvas object for offscreen rendering.
canvas = love.graphics.newCanvas()
canvas Canvas A new Canvas with dimensions equal to the window's size in pixels.
canvas = love.graphics.newCanvas( width, height )
width number The desired width of the Canvas.
height number The desired height of the Canvas.
canvas Canvas A new Canvas with specified width and height.
canvas = love.graphics.newCanvas( width, height, settings )
width number The desired width of the Canvas.
height number The desired height of the Canvas.
settings table A table containing the given fields:
settings.type ('2d') TextureType The type of Canvas to create.
settings.format ('normal') PixelFormat The format of the Canvas.
settings.readable boolean Whether the Canvas is readable (drawable and accessible in a Shader). True by default for regular formats, false by default for depth/stencil formats.
settings.msaa (0) number The desired number of multisample antialiasing (MSAA) samples used when drawing to the Canvas.
settings.dpiscale (love.graphics.getDPIScale()) number The DPI scale factor of the Canvas, used when drawing to the Canvas as well as when drawing the Canvas to the screen.
settings.mipmaps ('none') MipmapMode Whether the Canvas has mipmaps, and whether to automatically regenerate them if so.
canvas Canvas A new Canvas with specified width and height.
canvas = love.graphics.newCanvas( width, height, layers, settings )
width number The desired width of the Canvas.
height number The desired height of the Canvas.
layers number The number of array layers (if the Canvas is an Array Texture), or the volume depth (if the Canvas is a Volume Texture).
settings table A table containing the given fields:
settings.type ('array') TextureType The type of Canvas to create.
settings.format ('normal') PixelFormat The format of the Canvas.
settings.readable boolean Whether the Canvas is readable (drawable and accessible in a Shader). True by default for regular formats, false by default for depth/stencil formats.
settings.msaa (0) number The desired number of multisample antialiasing (MSAA) samples used when drawing to the Canvas.
settings.dpiscale (love.graphics.getDPIScale()) number The DPI scale factor of the Canvas, used when drawing to the Canvas as well as when drawing the Canvas to the screen.
settings.mipmaps ('none') MipmapMode Whether the Canvas has mipmaps, and whether to automatically regenerate them if so.
canvas Canvas A new Canvas with specified width and height.
love.graphics.newCubeImage
Creates a new cubemap Image.

Cubemap images have 6 faces (sides) which represent a cube. 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 cubemap image in a Shader, it must be declared as a CubeImage or samplerCube type (instead of Image or sampler2D). The Texel(CubeImage image, vec3 direction) shader function must be used to get pixel colors from the cubemap. The vec3 argument is a normalized direction from the center of the cube, rather than explicit texture coordinates.

Each face in a cubemap image must have square dimensions.

For variants of this function which accept a single image containing multiple cubemap faces, they must be laid out in one of the following forms in the image:

+y

+z +x -z

-y

-x

or:

+y

-x +z +x -z

-y

or:

+x

-x

+y

-y

+z

-z

or:

+x -x +y -y +z -z
image = love.graphics.newCubeImage( filename, settings )
filename string The filepath to a cubemap image file (or a File, FileData, or ImageData).
settings (nil) table Optional table of settings to configure the cubemap 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 An cubemap Image object.
image = love.graphics.newCubeImage( faces, settings )
faces table A table containing 6 filepaths to images (or File, FileData, ImageData, or CompressedImageData objects), in an array. Each face image must have the same dimensions. A table of tables can also be given, where each sub-table contains all mipmap levels for the cube face index of that sub-table.
settings (nil) table Optional table of settings to configure the cubemap 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 An cubemap Image object.
love.graphics.newFont
Creates a new Font from a TrueType Font or BMFont file. Created fonts are not cached, in that calling this function with the same arguments will always create a new Font object.

All variants which accept a filename can also accept a Data object instead.
font = love.graphics.newFont( filename )
filename string The filepath to the BMFont or TrueType font file.
font Font A Font object which can be used to draw text on screen.
font = love.graphics.newFont( filename, size, hinting, dpiscale )
filename string The filepath to the TrueType font file.
size number The size of the font in pixels.
hinting ('normal') HintingMode True Type hinting mode.
dpiscale (love.graphics.getDPIScale()) number The DPI scale factor of the font.
font Font A Font object which can be used to draw text on screen.
font = love.graphics.newFont( filename, imagefilename )
filename string The filepath to the BMFont file.
imagefilename string The filepath to the BMFont's image file. If this argument is omitted, the path specified inside the BMFont file will be used.
font Font A Font object which can be used to draw text on screen.
font = love.graphics.newFont( size, hinting, dpiscale )
size (12) number The size of the font in pixels.
hinting ('normal') HintingMode True Type hinting mode.
dpiscale (love.graphics.getDPIScale()) number The DPI scale factor of the font.
font Font A Font object which can be used to draw text on screen.
love.graphics.newImage
Creates a new Image from a filepath, FileData, an ImageData, or a CompressedImageData, and optionally generates or specifies mipmaps for the image.
image = love.graphics.newImage( filename, settings )
filename string The filepath to the image file.
settings table A table containing the following fields:
settings.dpiscale (1) number The DPI scale to use when drawing the image and calling getWidth/getHeight.
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.
settings.mipmaps (false) boolean If true, mipmaps for the image will be automatically generated (or taken from the images's file if possible, if the image originated from a CompressedImageData).
image Image A new Image object which can be drawn on screen.
image = love.graphics.newImage( fileData, settings )
fileData FileData The FileData containing image file.
settings table A table containing the following fields:
settings.dpiscale (1) number The DPI scale to use when drawing the image and calling getWidth/getHeight.
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.
settings.mipmaps (false) boolean If true, mipmaps for the image will be automatically generated (or taken from the images's file if possible, if the image originated from a CompressedImageData).
image Image A new Image object which can be drawn on screen.
image = love.graphics.newImage( imageData, settings )
imageData ImageData The ImageData containing image.
settings table A table containing the following fields:
settings.dpiscale (1) number The DPI scale to use when drawing the image and calling getWidth/getHeight.
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.
settings.mipmaps (false) boolean If true, mipmaps for the image will be automatically generated (or taken from the images's file if possible, if the image originated from a CompressedImageData).
image Image A new Image object which can be drawn on screen.
image = love.graphics.newImage( compressedImageData, settings )
compressedImageData CompressedImageData A CompressedImageData object. The Image will use this CompressedImageData to reload itself when love.window.setMode is called.
settings table A table containing the following fields:
settings.dpiscale (1) number The DPI scale to use when drawing the image and calling getWidth/getHeight.
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.
settings.mipmaps (false) boolean If true, mipmaps for the image will be automatically generated (or taken from the images's file if possible, if the image originated from a CompressedImageData).
image Image A new Image object which can be drawn on screen.
love.graphics.newImageFont
Creates a new specifically formatted image.

In versions prior to 0.9.0, LÖVE expects ISO 8859-1 encoding for the glyphs string.
font = love.graphics.newImageFont( filename, glyphs )
filename string The filepath to the image file.
glyphs string A string of the characters in the image in order from left to right.
font Font A Font object which can be used to draw text on screen.
font = love.graphics.newImageFont( imageData, glyphs )
imageData ImageData The ImageData object to create the font from.
glyphs string A string of the characters in the image in order from left to right.
font Font A Font object which can be used to draw text on screen.
font = love.graphics.newImageFont( filename, glyphs, extraspacing )
filename string The filepath to the image file.
glyphs string A string of the characters in the image in order from left to right.
extraspacing number Additional spacing (positive or negative) to apply to each glyph in the Font.
font Font A Font object which can be used to draw text on screen.
love.graphics.newParticleSystem
Creates a new ParticleSystem.
system = love.graphics.newParticleSystem( image, buffer )
image Image The image to use.
buffer (1000) number The max number of particles at the same time.
system ParticleSystem A new ParticleSystem.
system = love.graphics.newParticleSystem( texture, buffer )
texture Texture The texture (Image or Canvas) to use.
buffer (1000) number The max number of particles at the same time.
system ParticleSystem A new ParticleSystem.
love.graphics.newQuad
Creates a new Quad.

The purpose of a Quad is to use a fraction of an image to draw objects, as opposed to drawing entire image. It is most useful for sprite sheets and atlases: in a sprite atlas, multiple sprites reside in same image, quad is used to draw a specific sprite from that image; in animated sprites with all frames residing in the same image, quad is used to draw specific frame from the animation.
quad = love.graphics.newQuad( x, y, width, height, sw, sh )
x number The top-left position in the Image along the x-axis.
y number The top-left position in the Image along the y-axis.
width number The width of the Quad in the Image. (Must be greater than 0.)
height number The height of the Quad in the Image. (Must be greater than 0.)
sw number The reference width, the width of the Image. (Must be greater than 0.)
sh number The reference height, the height of the Image. (Must be greater than 0.)
quad Quad The new Quad.
quad = love.graphics.newQuad( x, y, width, height, texture )
x number The top-left position in the Image along the x-axis.
y number The top-left position in the Image along the y-axis.
width number The width of the Quad in the Image. (Must be greater than 0.)
height number The height of the Quad in the Image. (Must be greater than 0.)
texture Texture The texture whose width and height will be used as the reference width and height.
quad Quad The new Quad.
love.graphics.newShader
Creates a new Shader object for hardware-accelerated vertex and pixel effects. A Shader contains either vertex shader code, pixel shader code, or both.

Shaders are small programs which are run on the graphics card when drawing. Vertex shaders are run once for each vertex (for example, an image has 4 vertices - one at each corner. A Mesh might have many more.) Pixel shaders are run once for each pixel on the screen which the drawn object touches. Pixel shader code is executed after all the object's vertices have been processed by the vertex shader.
shader = love.graphics.newShader( code )
code string The pixel shader or vertex shader code, or a filename pointing to a file with the code.
shader Shader A Shader object for use in drawing operations.
shader = love.graphics.newShader( pixelcode, vertexcode )
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.
shader Shader A Shader object for use in drawing operations.
love.graphics.newSpriteBatch
Creates a new SpriteBatch object.
spriteBatch = love.graphics.newSpriteBatch( image, maxsprites )
image Image The Image to use for the sprites.
maxsprites (1000) number The maximum number of sprites that the SpriteBatch can contain at any given time. Since version 11.0, additional sprites added past this number will automatically grow the spritebatch.
spriteBatch SpriteBatch The new SpriteBatch.
spriteBatch = love.graphics.newSpriteBatch( image, maxsprites, usage )
image Image The Image to use for the sprites.
maxsprites (1000) number The maximum number of sprites that the SpriteBatch can contain at any given time. Since version 11.0, additional sprites added past this number will automatically grow the spritebatch.
usage ('dynamic') SpriteBatchUsage The expected usage of the SpriteBatch. The specified usage mode affects the SpriteBatch's memory usage and performance.
spriteBatch SpriteBatch The new SpriteBatch.
spriteBatch = love.graphics.newSpriteBatch( texture, maxsprites, usage )
texture Texture The Image or Canvas to use for the sprites.
maxsprites (1000) number The maximum number of sprites that the SpriteBatch can contain at any given time. Since version 11.0, additional sprites added past this number will automatically grow the spritebatch.
usage ('dynamic') SpriteBatchUsage The expected usage of the SpriteBatch. The specified usage mode affects the SpriteBatch's memory usage and performance.
spriteBatch SpriteBatch The new SpriteBatch.