Nocare3/love2dapi_chunks huggingface dataset:
ParticleSystem:getParticleLifetime
Gets the lifetime of the particles.
min, max = ParticleSystem:getParticleLifetime()
min number The minimum life of the particles (in seconds).
max number The maximum life of the particles (in seconds).
ParticleSystem:getPosition
Gets the position of the emitter.
x, y = ParticleSystem:getPosition()
x number Position along x-axis.
y number Position along y-axis.
ParticleSystem:getQuads
Gets the series of Quads used for the particle sprites.
quads = ParticleSystem:getQuads()
quads table A table containing the Quads used.
ParticleSystem:getRadialAcceleration
Gets the radial acceleration (away from the emitter).
min, max = ParticleSystem:getRadialAcceleration()
min number The minimum acceleration.
max number The maximum acceleration.
ParticleSystem:getRotation
Gets the rotation of the image upon particle creation (in radians).
min, max = ParticleSystem:getRotation()
min number The minimum initial angle (radians).
max number The maximum initial angle (radians).
ParticleSystem:getSizeVariation
Gets the amount of size variation (0 meaning no variation and 1 meaning full variation between start and end).
variation = ParticleSystem:getSizeVariation()
variation number The amount of variation (0 meaning no variation and 1 meaning full variation between start and end).
ParticleSystem:getSizes
Gets the series of sizes by which the sprite is scaled. 1.0 is normal size. The particle system will interpolate between each size evenly over the particle's lifetime.
size1, size2, size8 = ParticleSystem:getSizes()
size1 number The first size.
size2 number The second size.
size8 number The eighth size.
ParticleSystem:getSpeed
Gets the speed of the particles.
min, max = ParticleSystem:getSpeed()
min number The minimum linear speed of the particles.
max number The maximum linear speed of the particles.
ParticleSystem:getSpin
Gets the spin of the sprite.
min, max, variation = ParticleSystem:getSpin()
min number The minimum spin (radians per second).
max number The maximum spin (radians per second).
variation number The degree of variation (0 meaning no variation and 1 meaning full variation between start and end).
ParticleSystem:getSpinVariation
Gets the amount of spin variation (0 meaning no variation and 1 meaning full variation between start and end).
variation = ParticleSystem:getSpinVariation()
variation number The amount of variation (0 meaning no variation and 1 meaning full variation between start and end).
ParticleSystem:getSpread
Gets the amount of directional spread of the particle emitter (in radians).
spread = ParticleSystem:getSpread()
spread number The spread of the emitter (radians).
ParticleSystem:getTangentialAcceleration
Gets the tangential acceleration (acceleration perpendicular to the particle's direction).
min, max = ParticleSystem:getTangentialAcceleration()
min number The minimum acceleration.
max number The maximum acceleration.
ParticleSystem:getTexture
Gets the texture (Image or Canvas) used for the particles.
texture = ParticleSystem:getTexture()
texture Texture The Image or Canvas used for the particles.
ParticleSystem:hasRelativeRotation
Gets whether particle angles and rotations are relative to their velocities. If enabled, particles are aligned to the angle of their velocities and rotate relative to that angle.
enable = ParticleSystem:hasRelativeRotation()
enable boolean True if relative particle rotation is enabled, false if it's disabled.
ParticleSystem:isActive
Checks whether the particle system is actively emitting particles.
active = ParticleSystem:isActive()
active boolean True if system is active, false otherwise.
ParticleSystem:isPaused
Checks whether the particle system is paused.
paused = ParticleSystem:isPaused()
paused boolean True if system is paused, false otherwise.
ParticleSystem:isStopped
Checks whether the particle system is stopped.
stopped = ParticleSystem:isStopped()
stopped boolean True if system is stopped, false otherwise.
ParticleSystem:moveTo
Moves the position of the emitter. This results in smoother particle spawning behaviour than if ParticleSystem:setPosition is used every frame.
ParticleSystem:moveTo( x, y )
x number Position along x-axis.
y number Position along y-axis.
ParticleSystem:pause
Pauses the particle emitter.
ParticleSystem:pause()
ParticleSystem:reset
Resets the particle emitter, removing any existing particles and resetting the lifetime counter.
ParticleSystem:reset()
ParticleSystem:setBufferSize
Sets the size of the buffer (the max allowed amount of particles in the system).
ParticleSystem:setBufferSize( size )
size number The buffer size.
ParticleSystem:setColors
Sets a series of colors to apply to the particle sprite. The particle system will interpolate between each color evenly over the particle's lifetime.

Arguments can be passed in groups of four, representing the components of the desired RGBA value, or as tables of RGBA component values, with a default alpha value of 1 if only three values are given. At least one color must be specified. A maximum of eight may be used.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
ParticleSystem:setColors( r1, g1, b1, a1, ... )
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 (1) number First color, alpha component (0-1).
... number Additional colors.
ParticleSystem:setColors( rgba1, ... )
rgba1 table First color, a numerical indexed table with the red, green, blue and alpha values as numbers (0-1). The alpha is optional and defaults to 1 if it is left out.
... table Additional color, a numerical indexed table with the red, green, blue and alpha values as numbers (0-1). The alpha is optional and defaults to 1 if it is left out.
ParticleSystem:setDirection
Sets the direction the particles will be emitted in.
ParticleSystem:setDirection( direction )
direction number The direction of the particles (in radians).
ParticleSystem:setEmissionArea
Sets area-based spawn parameters for the particles. Newly created particles will spawn in an area around the emitter based on the parameters to this function.
ParticleSystem:setEmissionArea( distribution, dx, dy, angle, directionRelativeToCenter )
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 (0) number The angle in radians of the emission area.
directionRelativeToCenter (false) boolean True if newly spawned particles will be oriented relative to the center of the emission area, false otherwise.
ParticleSystem:setEmissionRate
Sets the amount of particles emitted per second.
ParticleSystem:setEmissionRate( rate )
rate number The amount of particles per second.
ParticleSystem:setEmitterLifetime
Sets how long the particle system should emit particles (if -1 then it emits particles forever).
ParticleSystem:setEmitterLifetime( life )
life number The lifetime of the emitter (in seconds).
ParticleSystem:setInsertMode
Sets the mode to use when the ParticleSystem adds new particles.
ParticleSystem:setInsertMode( mode )
mode ParticleInsertMode The mode to use when the ParticleSystem adds new particles.
ParticleSystem:setLinearAcceleration
Sets 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.
ParticleSystem:setLinearAcceleration( xmin, ymin, xmax, ymax )
xmin number The minimum acceleration along the x axis.
ymin number The minimum acceleration along the y axis.
xmax (xmin) number The maximum acceleration along the x axis.
ymax (ymin) number The maximum acceleration along the y axis.
ParticleSystem:setLinearDamping
Sets the amount of linear damping (constant deceleration) for particles.
ParticleSystem:setLinearDamping( min, max )
min number The minimum amount of linear damping applied to particles.
max (min) number The maximum amount of linear damping applied to particles.
ParticleSystem:setOffset
Set the offset position which the particle sprite is rotated around.

If this function is not used, the particles rotate around their center.
ParticleSystem:setOffset( x, y )
x number The x coordinate of the rotation offset.
y number The y coordinate of the rotation offset.
ParticleSystem:setParticleLifetime
Sets the lifetime of the particles.
ParticleSystem:setParticleLifetime( min, max )
min number The minimum life of the particles (in seconds).
max (min) number The maximum life of the particles (in seconds).
ParticleSystem:setPosition
Sets the position of the emitter.
ParticleSystem:setPosition( x, y )
x number Position along x-axis.
y number Position along y-axis.
ParticleSystem:setQuads
Sets a series of Quads to use for the particle sprites. Particles will choose a Quad from the list based on the particle's current lifetime, allowing for the use of animated sprite sheets with ParticleSystems.
ParticleSystem:setQuads( quad1, ... )
quad1 Quad The first Quad to use.
... Quad Additional Quads to use.
ParticleSystem:setQuads( quads )
quads table A table containing the Quads to use.
ParticleSystem:setRadialAcceleration
Set the radial acceleration (away from the emitter).
ParticleSystem:setRadialAcceleration( min, max )
min number The minimum acceleration.
max (min) number The maximum acceleration.
ParticleSystem:setRelativeRotation
Sets whether particle angles and rotations are relative to their velocities. If enabled, particles are aligned to the angle of their velocities and rotate relative to that angle.
ParticleSystem:setRelativeRotation( enable )
enable boolean True to enable relative particle rotation, false to disable it.
ParticleSystem:setRotation
Sets the rotation of the image upon particle creation (in radians).
ParticleSystem:setRotation( min, max )
min number The minimum initial angle (radians).
max (min) number The maximum initial angle (radians).
ParticleSystem:setSizeVariation
Sets the amount of size variation (0 meaning no variation and 1 meaning full variation between start and end).
ParticleSystem:setSizeVariation( variation )
variation number The amount of variation (0 meaning no variation and 1 meaning full variation between start and end).
ParticleSystem:setSizes
Sets a series of sizes by which to scale a particle sprite. 1.0 is normal size. The particle system will interpolate between each size evenly over the particle's lifetime.

At least one size must be specified. A maximum of eight may be used.
ParticleSystem:setSizes( size1, size2, size8 )
size1 number The first size.
size2 (nil) number The second size.
size8 (nil) number The eighth size.
ParticleSystem:setSpeed
Sets the speed of the particles.
ParticleSystem:setSpeed( min, max )
min number The minimum linear speed of the particles.
max (min) number The maximum linear speed of the particles.
ParticleSystem:setSpin
Sets the spin of the sprite.
ParticleSystem:setSpin( min, max )
min number The minimum spin (radians per second).
max (min) number The maximum spin (radians per second).
ParticleSystem:setSpinVariation
Sets the amount of spin variation (0 meaning no variation and 1 meaning full variation between start and end).
ParticleSystem:setSpinVariation( variation )
variation number The amount of variation (0 meaning no variation and 1 meaning full variation between start and end).
ParticleSystem:setSpread
Sets the amount of spread for the system.
ParticleSystem:setSpread( spread )
spread number The amount of spread (radians).
ParticleSystem:setTangentialAcceleration
Sets the tangential acceleration (acceleration perpendicular to the particle's direction).
ParticleSystem:setTangentialAcceleration( min, max )
min number The minimum acceleration.
max (min) number The maximum acceleration.
ParticleSystem:setTexture
Sets the texture (Image or Canvas) to be used for the particles.
ParticleSystem:setTexture( texture )
texture Texture An Image or Canvas to use for the particles.
ParticleSystem:start
Starts the particle emitter.
ParticleSystem:start()
ParticleSystem:stop
Stops the particle emitter, resetting the lifetime counter.
ParticleSystem:stop()
ParticleSystem:update
Updates the particle system; moving, creating and killing particles.
ParticleSystem:update( dt )
dt number The time (seconds) since last frame.
Quad:getTextureDimensions
Gets reference texture dimensions initially specified in love.graphics.newQuad.
sw, sh = Quad:getTextureDimensions()
sw number The Texture width used by the Quad.
sh number The Texture height used by the Quad.
Quad:getViewport
Gets the current viewport of this Quad.
x, y, w, h = Quad:getViewport()
x number The top-left corner along the x-axis.
y number The top-left corner along the y-axis.
w number The width of the viewport.
h number The height of the viewport.
Quad:setViewport
Sets the texture coordinates according to a viewport.
Quad:setViewport( x, y, w, h, sw, sh )
x number The top-left corner along the x-axis.
y number The top-left corner along the y-axis.
w number The width of the viewport.
h number The height of the viewport.
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.)
Shader:getWarnings
Returns any warning and error messages from compiling the shader code. This can be used for debugging your shaders if there's anything the graphics hardware doesn't like.
warnings = Shader:getWarnings()
warnings string Warning and error messages (if any).
Shader:hasUniform
Gets whether a uniform / extern variable exists in the Shader.

If a graphics driver's shader compiler determines that a uniform / extern variable doesn't affect the final output of the shader, it may optimize the variable out. This function will return false in that case.
hasuniform = Shader:hasUniform( name )
name string The name of the uniform variable.
hasuniform boolean Whether the uniform exists in the shader and affects its final output.
Shader:sendColor
Sends one or more colors to a special (''extern'' / ''uniform'') vec3 or vec4 variable inside the shader. The color components must be in the range of 1. The colors are gamma-corrected if global gamma-correction is enabled.

Extern variables must be marked using the ''extern'' keyword, e.g.

extern vec4 Color;

The corresponding sendColor call would be

shader:sendColor('Color', {r, g, b, a})

Extern variables can be accessed in both the Vertex and Pixel stages of a shader, as long as the variable is declared in each.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
Shader:sendColor( name, color, ... )
name string The name of the color extern variable to send to in the shader.
color table A table with red, green, blue, and optional alpha color components in the range of 1 to send to the extern as a vector.
... table Additional colors to send in case the extern is an array. All colors need to be of the same size (e.g. only vec3's).
SpriteBatch:add
Adds a sprite to the batch. Sprites are drawn in the order they are added.
id = SpriteBatch:add( x, y, r, sx, sy, ox, oy, kx, ky )
x number The position to draw the object (x-axis).
y number The position to draw the object (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 Shear factor (x-axis).
ky (0) number Shear factor (y-axis).
id number An identifier for the added sprite.
id = SpriteBatch:add( quad, x, y, r, sx, sy, ox, oy, kx, ky )
quad Quad The Quad to add.
x number The position to draw the object (x-axis).
y number The position to draw the object (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 Shear factor (x-axis).
ky (0) number Shear factor (y-axis).
id number An identifier for the added sprite.
SpriteBatch:addLayer
Adds a sprite to a batch created with an Array Texture.
spriteindex = SpriteBatch:addLayer( layerindex, x, y, r, sx, sy, ox, oy, kx, ky )
layerindex number The index of the layer 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).
spriteindex number The index of the added sprite, for use with SpriteBatch:set or SpriteBatch:setLayer.
spriteindex = SpriteBatch:addLayer( layerindex, quad, x, y, r, sx, sy, ox, oy, kx, ky )
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).
spriteindex number The index of the added sprite, for use with SpriteBatch:set or SpriteBatch:setLayer.
spriteindex = SpriteBatch:addLayer( layerindex, transform )
layerindex number The index of the layer to use for this sprite.
transform Transform A transform object.
spriteindex number The index of the added sprite, for use with SpriteBatch:set or SpriteBatch:setLayer.
spriteindex = SpriteBatch:addLayer( layerindex, quad, transform )
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.
transform Transform A transform object.
spriteindex number The index of the added sprite, for use with SpriteBatch:set or SpriteBatch:setLayer.
SpriteBatch:attachAttribute
Attaches a per-vertex attribute from a Mesh onto this SpriteBatch, for use when drawing. This can be combined with a Shader to augment a SpriteBatch with per-vertex or additional per-sprite information instead of just having per-sprite colors.

Each sprite in a SpriteBatch has 4 vertices in the following order: top-left, bottom-left, top-right, bottom-right. The index returned by SpriteBatch:add (and used by SpriteBatch:set) can used to determine the first vertex of a specific sprite with the formula 1 + 4 * ( id - 1 ).
SpriteBatch:attachAttribute( name, mesh )
name string The name of the vertex attribute to attach.
mesh Mesh The Mesh to get the vertex attribute from.
SpriteBatch:clear
Removes all sprites from the buffer.
SpriteBatch:clear()
SpriteBatch:flush
Immediately sends all new and modified sprite data in the batch to the graphics card.

Normally it isn't necessary to call this method as love.graphics.draw(spritebatch, ...) will do it automatically if needed, but explicitly using SpriteBatch: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(spritebatch, ...) calls.
SpriteBatch:flush()
SpriteBatch:getBufferSize
Gets the maximum number of sprites the SpriteBatch can hold.
size = SpriteBatch:getBufferSize()
size number The maximum number of sprites the batch can hold.
SpriteBatch:getColor
Gets the color that will be used for the next add and set operations.

If no color has been set with SpriteBatch:setColor or the current SpriteBatch color has been cleared, this method will return nil.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.
r, g, b, a = SpriteBatch:getColor()
r number The red component (0-1).
g number The green component (0-1).
b number The blue component (0-1).
a number The alpha component (0-1).
SpriteBatch:getCount
Gets the number of sprites currently in the SpriteBatch.
count = SpriteBatch:getCount()
count number The number of sprites currently in the batch.
SpriteBatch:getTexture
Gets the texture (Image or Canvas) used by the SpriteBatch.
texture = SpriteBatch:getTexture()
texture Texture The Image or Canvas used by the SpriteBatch.
SpriteBatch:set
Changes a sprite in the batch. This requires the sprite index returned by SpriteBatch:add or SpriteBatch:addLayer.
SpriteBatch:set( spriteindex, x, y, r, sx, sy, ox, oy, kx, ky )
spriteindex number The index of the sprite that will be changed.
x number The position to draw the object (x-axis).
y number The position to draw the object (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 Shear factor (x-axis).
ky (0) number Shear factor (y-axis).
SpriteBatch:set( spriteindex, quad, x, y, r, sx, sy, ox, oy, kx, ky )
spriteindex number The index of the sprite that will be changed.
quad Quad The Quad used on the image of the batch.
x number The position to draw the object (x-axis).
y number The position to draw the object (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 Shear factor (x-axis).
ky (0) number Shear factor (y-axis).
SpriteBatch:setColor
Sets the color that will be used for the next add and set operations. Calling the function without arguments will disable all per-sprite colors for the SpriteBatch.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

In version 0.9.2 and older, the global color set with love.graphics.setColor will not work on the SpriteBatch if any of the sprites has its own color.
SpriteBatch:setColor( r, g, b, a )
r number The amount of red.
g number The amount of green.
b number The amount of blue.
a (1) number The amount of alpha.
SpriteBatch:setColor()
SpriteBatch:setDrawRange
Restricts the drawn sprites in the SpriteBatch to a subset of the total.
SpriteBatch:setDrawRange( start, count )
start number The index of the first sprite to draw. Index 1 corresponds to the first sprite added with SpriteBatch:add.
count number The number of sprites to draw.
SpriteBatch:setDrawRange()