main function
stringlengths
8
40
chunks
stringlengths
41
8.32k
repo_name
stringclasses
1 value
love.graphics.shear
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.
love2d-community.github.io/love-api
love.graphics.stencil
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.
love2d-community.github.io/love-api
love.graphics.transformPoint
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.
love2d-community.github.io/love-api
love.graphics.translate
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.
love2d-community.github.io/love-api
love.graphics.validateShader
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).
love2d-community.github.io/love-api
Canvas:generateMipmaps
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()
love2d-community.github.io/love-api
Canvas:getMSAA
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.
love2d-community.github.io/love-api
Canvas:getMipmapMode
Canvas:getMipmapMode Gets the MipmapMode this Canvas was created with. mode = Canvas:getMipmapMode() mode MipmapMode The mipmap mode this Canvas was created with.
love2d-community.github.io/love-api
Canvas:newImageData
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.
love2d-community.github.io/love-api
Canvas:renderTo
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.
love2d-community.github.io/love-api
Font:getAscent
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.
love2d-community.github.io/love-api
Font:getBaseline
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.
love2d-community.github.io/love-api
Font:getDPIScale
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.
love2d-community.github.io/love-api
Font:getDescent
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.
love2d-community.github.io/love-api
Font:getFilter
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.
love2d-community.github.io/love-api
Font:getHeight
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.
love2d-community.github.io/love-api
Font:getKerning
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.
love2d-community.github.io/love-api
Font:getLineHeight
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.
love2d-community.github.io/love-api
Font:getWidth
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.
love2d-community.github.io/love-api
Font:getWrap
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.
love2d-community.github.io/love-api
Font:hasGlyphs
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.
love2d-community.github.io/love-api
Font:setFallbacks
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.
love2d-community.github.io/love-api
Font:setFilter
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.
love2d-community.github.io/love-api
Font:setLineHeight
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.
love2d-community.github.io/love-api
Image:isCompressed
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.
love2d-community.github.io/love-api
Image:isFormatLinear
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.
love2d-community.github.io/love-api
Image:replacePixels
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.
love2d-community.github.io/love-api
Mesh:attachAttribute
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.
love2d-community.github.io/love-api
Mesh:detachAttribute
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.
love2d-community.github.io/love-api
Mesh:flush
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()
love2d-community.github.io/love-api
Mesh:getDrawMode
Mesh:getDrawMode Gets the mode used when drawing the Mesh. mode = Mesh:getDrawMode() mode MeshDrawMode The mode used when drawing the Mesh.
love2d-community.github.io/love-api
Mesh:getDrawRange
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.
love2d-community.github.io/love-api
Mesh:getTexture
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.
love2d-community.github.io/love-api
Mesh:getVertex
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.
love2d-community.github.io/love-api
Mesh:getVertexAttribute
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.
love2d-community.github.io/love-api
Mesh:getVertexCount
Mesh:getVertexCount Gets the total number of vertices in the Mesh. count = Mesh:getVertexCount() count number The total number of vertices in the mesh.
love2d-community.github.io/love-api
Mesh:getVertexFormat
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.
love2d-community.github.io/love-api
Mesh:getVertexMap
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.
love2d-community.github.io/love-api
Mesh:isAttributeEnabled
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.
love2d-community.github.io/love-api
Mesh:setAttributeEnabled
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.
love2d-community.github.io/love-api
Mesh:setDrawMode
Mesh:setDrawMode Sets the mode used when drawing the Mesh. Mesh:setDrawMode( mode ) mode MeshDrawMode The mode to use when drawing the Mesh.
love2d-community.github.io/love-api
Mesh:setDrawRange
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()
love2d-community.github.io/love-api
Mesh:setTexture
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()
love2d-community.github.io/love-api
Mesh:setVertex
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.
love2d-community.github.io/love-api
Mesh:setVertexAttribute
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.
love2d-community.github.io/love-api
Mesh:setVertexMap
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.
love2d-community.github.io/love-api
Mesh:setVertices
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.
love2d-community.github.io/love-api
ParticleSystem:clone
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.
love2d-community.github.io/love-api
ParticleSystem:emit
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.
love2d-community.github.io/love-api
ParticleSystem:getBufferSize
ParticleSystem:getBufferSize Gets the maximum number of particles the ParticleSystem can have at once. size = ParticleSystem:getBufferSize() size number The maximum number of particles.
love2d-community.github.io/love-api
ParticleSystem:getColors
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).
love2d-community.github.io/love-api
ParticleSystem:getCount
ParticleSystem:getCount Gets the number of particles that are currently in the system. count = ParticleSystem:getCount() count number The current number of live particles.
love2d-community.github.io/love-api
ParticleSystem:getDirection
ParticleSystem:getDirection Gets the direction of the particle emitter (in radians). direction = ParticleSystem:getDirection() direction number The direction of the emitter (radians).
love2d-community.github.io/love-api
ParticleSystem:getEmissionArea
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.
love2d-community.github.io/love-api
ParticleSystem:getEmissionRate
ParticleSystem:getEmissionRate Gets the amount of particles emitted per second. rate = ParticleSystem:getEmissionRate() rate number The amount of particles per second.
love2d-community.github.io/love-api
ParticleSystem:getEmitterLifetime
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).
love2d-community.github.io/love-api
ParticleSystem:getInsertMode
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.
love2d-community.github.io/love-api
ParticleSystem:getLinearAcceleration
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.
love2d-community.github.io/love-api
ParticleSystem:getLinearDamping
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.
love2d-community.github.io/love-api
ParticleSystem:getOffset
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.
love2d-community.github.io/love-api
ParticleSystem:getParticleLifetime
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).
love2d-community.github.io/love-api
ParticleSystem:getPosition
ParticleSystem:getPosition Gets the position of the emitter. x, y = ParticleSystem:getPosition() x number Position along x-axis. y number Position along y-axis.
love2d-community.github.io/love-api
ParticleSystem:getQuads
ParticleSystem:getQuads Gets the series of Quads used for the particle sprites. quads = ParticleSystem:getQuads() quads table A table containing the Quads used.
love2d-community.github.io/love-api
ParticleSystem:getRadialAcceleration
ParticleSystem:getRadialAcceleration Gets the radial acceleration (away from the emitter). min, max = ParticleSystem:getRadialAcceleration() min number The minimum acceleration. max number The maximum acceleration.
love2d-community.github.io/love-api
ParticleSystem:getRotation
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).
love2d-community.github.io/love-api
ParticleSystem:getSizeVariation
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).
love2d-community.github.io/love-api
ParticleSystem:getSizes
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.
love2d-community.github.io/love-api
ParticleSystem:getSpeed
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.
love2d-community.github.io/love-api
ParticleSystem:getSpin
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).
love2d-community.github.io/love-api
ParticleSystem:getSpinVariation
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).
love2d-community.github.io/love-api
ParticleSystem:getSpread
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).
love2d-community.github.io/love-api
ParticleSystem:getTangentialAcceleration
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.
love2d-community.github.io/love-api
ParticleSystem:getTexture
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.
love2d-community.github.io/love-api
ParticleSystem:hasRelativeRotation
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.
love2d-community.github.io/love-api
ParticleSystem:isActive
ParticleSystem:isActive Checks whether the particle system is actively emitting particles. active = ParticleSystem:isActive() active boolean True if system is active, false otherwise.
love2d-community.github.io/love-api
ParticleSystem:isPaused
ParticleSystem:isPaused Checks whether the particle system is paused. paused = ParticleSystem:isPaused() paused boolean True if system is paused, false otherwise.
love2d-community.github.io/love-api
ParticleSystem:isStopped
ParticleSystem:isStopped Checks whether the particle system is stopped. stopped = ParticleSystem:isStopped() stopped boolean True if system is stopped, false otherwise.
love2d-community.github.io/love-api
ParticleSystem:moveTo
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.
love2d-community.github.io/love-api
ParticleSystem:pause
ParticleSystem:pause Pauses the particle emitter. ParticleSystem:pause()
love2d-community.github.io/love-api
ParticleSystem:reset
ParticleSystem:reset Resets the particle emitter, removing any existing particles and resetting the lifetime counter. ParticleSystem:reset()
love2d-community.github.io/love-api
ParticleSystem:setBufferSize
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.
love2d-community.github.io/love-api
ParticleSystem:setColors
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.
love2d-community.github.io/love-api
ParticleSystem:setDirection
ParticleSystem:setDirection Sets the direction the particles will be emitted in. ParticleSystem:setDirection( direction ) direction number The direction of the particles (in radians).
love2d-community.github.io/love-api
ParticleSystem:setEmissionArea
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.
love2d-community.github.io/love-api
ParticleSystem:setEmissionRate
ParticleSystem:setEmissionRate Sets the amount of particles emitted per second. ParticleSystem:setEmissionRate( rate ) rate number The amount of particles per second.
love2d-community.github.io/love-api
ParticleSystem:setEmitterLifetime
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).
love2d-community.github.io/love-api
ParticleSystem:setInsertMode
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.
love2d-community.github.io/love-api
ParticleSystem:setLinearAcceleration
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.
love2d-community.github.io/love-api
ParticleSystem:setLinearDamping
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.
love2d-community.github.io/love-api
ParticleSystem:setOffset
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.
love2d-community.github.io/love-api
ParticleSystem:setParticleLifetime
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).
love2d-community.github.io/love-api
ParticleSystem:setPosition
ParticleSystem:setPosition Sets the position of the emitter. ParticleSystem:setPosition( x, y ) x number Position along x-axis. y number Position along y-axis.
love2d-community.github.io/love-api
ParticleSystem:setQuads
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.
love2d-community.github.io/love-api
ParticleSystem:setRadialAcceleration
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.
love2d-community.github.io/love-api
ParticleSystem:setRelativeRotation
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.
love2d-community.github.io/love-api
ParticleSystem:setRotation
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).
love2d-community.github.io/love-api
ParticleSystem:setSizeVariation
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).
love2d-community.github.io/love-api
ParticleSystem:setSizes
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.
love2d-community.github.io/love-api
ParticleSystem:setSpeed
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.
love2d-community.github.io/love-api
ParticleSystem:setSpin
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).
love2d-community.github.io/love-api