data = { --'# Graphics', '## Drawing', { prefix = "love.graphics.", name = "draw", description = [[Draws objects on screen. Drawable objects are loaded images, but may be other kinds of Drawable objects, such as a ParticleSystem. In addition to simple drawing, this function can rotate and scale the object at the same time, as well as offset the image (for example, to center the image at the chosen coordinates). love.graphics.draw anchors from the top left corner by default. You can specify a negative value for sx or sy to flip the drawable horizontally or vertically. The pivotal point is (x, y) on the screen and (ox, oy) in the internal coordinate system of the drawable object, before rotation and scaling. The object is scaled by (sx, sy), then rotated by r around the pivotal point. The default ColorMode blends the current drawing color into the image, so you will often want to invoke love.graphics.setColorMode("replace") before drawing images, to ensure that the drawn image matches the source image file. The origin offset values are most often used to shift the images up and left by half of its height and width, so that (effectively) the specified x and y coordinates are where the center of the image will end up.]], arguments = { { name = "Drawable", type = "object", description = [[A drawable object.]], }, { name = "x", type = "number", description = [[The position to draw the object (x-axis).]], default = [[0]]}, { name = "y", type = "number", description = [[The position to draw the object (y-axis).]], default = [[0]]}, { name = "r", type = "number", description = [[Orientation (radians).]], default = [[0]]}, { name = "sx", type = "number", description = [[Scale factor (x-axis). Can be negative.]], default = [[1]]}, { name = "sy", type = "number", description = [[Scale factor (y-axis). Can be negative.]], default = [[sx]]}, { name = "ox", type = "number", description = [[Origin offset (x-axis). (A value of 20 would effectively move your drawable object 20 pixels to the left.)]], default = [[0]]}, { name = "oy", type = "number", description = [[Origin offset (y-axis). (A value of 20 would effectively move your drawable object 20 pixels up.)]], default = [[0]]}, { name = "kx", type = "number", description = [[Shearing factor (x-axis).]], default = [[0]]}, { name = "ky", type = "number", description = [[Shearing factor (y-axis).]], default = [[0]]}, }, }, { prefix = "love.graphics.", name = "drawq", description = [[Draw a Quad with the specified Image on screen.]], arguments = { { name = "Image/Canvas", type = "object", description = [[An Image or Canvas to texture the quad with.]], }, { name = "Quad", type = "object", description = [[The quad to draw on screen.]], }, { name = "x", type = "number", description = [[The position to draw the object (x-axis).]], }, { name = "y", type = "number", description = [[The position to draw the object (y-axis).]], }, { name = "r", type = "number", description = [[Orientation (radians).]], default = [[0]]}, { name = "sx", type = "number", description = [[Scale factor (x-axis). Can be negative.]], default = [[1]]}, { name = "sy", type = "number", description = [[Scale factor (y-axis). Can be negative.]], default = [[sx]]}, { name = "ox", type = "number", description = [[Origin offset (x-axis).]], default = [[0]]}, { name = "oy", type = "number", description = [[Origin offset (y-axis)]], default = [[0]]}, { name = "kx", type = "number", description = [[Shearing factor (x-axis).]], default = [[0]]}, { name = "ky", type = "number", description = [[Shearing factor (y-axis).]], default = [[0]]}, }, }, '## Text', { prefix = "love.graphics.", name = "print", description = [[Draws text on screen. If no Font is set, one will be created and set (once) if needed. When using translation and scaling functions while drawing text, this function assumes the scale occurs first. If you don't script with this in mind, the text won't be in the right position, or possibly even on screen. love.graphics.print stops at the first null character. This can bite you if you are appending keystrokes to form your string, as some of those are multi-byte unicode characters which will likely contain null bytes.]], arguments = { { name = "text", type = "string", description = [[The text to draw.]], }, { name = "x", type = "number", description = [[The position to draw the object (x-axis).]], }, { name = "y", type = "number", description = [[The position to draw the object (y-axis).]], }, { name = "r", type = "number", description = [[Orientation (radians).]], default = [[0]]}, { name = "sx", type = "number", description = [[Scale factor (x-axis).]], default = [[1]]}, { name = "sy", type = "number", description = [[Scale factor (y-axis).]], default = [[sx]]}, { name = "ox", type = "number", description = [[Origin offset (x-axis).]], default = [[0]]}, { name = "oy", type = "number", description = [[Origin offset (y-axis).]], default = [[0]]}, { name = "kx", type = "number", description = [[Shear factor (x-axis).]], default = [[0]]}, { name = "ky", type = "number", description = [[Shear factor (y-axis).]], default = [[0]]}, }, }, { prefix = "love.graphics.", name = "printf", description = [[Draws formatted text, with word wrap and alignment. See additional notes in love.graphics.print.]], arguments = { { name = "text", type = "string", description = [[A text string.]], }, { name = "x", type = "number", description = [[The position on the x-axis.]], }, { name = "y", type = "number", description = [[The position on the y-axis.]], }, { name = "limit", type = "number", description = [[Wrap the line after this many horizontal pixels.]], }, { name = "align", type = "string", description = [[The alignment.]], default = [['left']], options = {"'left'", "'center'", "'right'"}}, }, }, '## Font', { prefix = "love.graphics.", name = "newFont", description = [[Creates a new Font.]], arguments = { { name = "path/File/FileData", type = "string", description = [[The file of the font file.]], default = [['Default font.']] }, { name = "size", type = "number", description = [[The size of the font in pixels.]], default = [[12]]}, }, returns = { { name = "Font", type = "object", description = [[A Font object which can be used to draw text on screen.]], }, }, }, { prefix = "love.graphics.", name = "setNewFont", description = [[Creates and sets a new font.]], arguments = { { name = "path/File/FileData", type = "string", description = [[The file to create the Font from.]], default = [[12]]}, { name = "size", type = "number", description = [[The size of the font.]], default = [[12]]}, }, returns = { { name = "Font", type = "object", description = [[The new font.]], }, }, }, { prefix = "love.graphics.", name = "newImageFont", description = [[Creates a new font by loading a specifically formatted image. There can be up to 256 glyphs. Expects ISO 8859-1 encoding for the glyphs string.]], arguments = { { name = "path/File/FileData/Image/ImageData", type = "string", description = [[The file of the image file.]], }, { name = "glyphs", type = "string", description = [[A string of the characters in the image in order from left to right.]], }, }, returns = { { name = "Font", type = "object", description = [[A Font object which can be used to draw text on screen.]], }, }, }, { prefix = "love.graphics.", name = "get/setFont", description = [[Get/set an already-loaded Font as the current font or create and load a new one from the file and size. It's recommended that Font objects are created with love.graphics.newFont in the loading stage and then passed to this function in the drawing stage.]], arguments = { { name = "Font", type = "object", description = [[The Font object to use.]], }, }, }, { prefix = "Font:", name = "getHeight", description = [[Gets the height of the Font. The height of the font is the size including any spacing; the height which it will need.]], returns = { { name = "height", type = "number", description = [[The height of the Font in pixels.]], }, }, }, { prefix = "Font:", name = "getWidth", description = [[Determines the horizontal size a line of text needs. Does not support line-breaks.]], arguments = { { name = "line", type = "string", description = [[A line of text.]], }, }, returns = { { name = "width", type = "number", description = [[The width of the line.]], }, }, }, { prefix = "Font:", name = "getWrap", description = [[Returns how many lines text would be wrapped to. This function accounts for newlines correctly (i.e. '\n')]], arguments = { { name = "text", type = "string", description = [[The text that would be wrapped.]], }, { name = "width", type = "number", description = [[The width to which text should be wrapped.]], }, }, returns = { { name = "width", type = "number", description = [[The actual width the wrapped text.]], }, { name = "lines", type = "number", description = [[The number of lines text was wrapped to.]], }, }, }, { prefix = "Font:", name = "get/setLineHeight", description = [[Gets/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.]], arguments = { { name = "height", type = "number", description = [[The new line height.]], }, }, }, '## Shapes', { prefix = "love.graphics.", name = "line", description = [[Draws lines between points.]], arguments = { { name = "x1", type = "number", description = [[The position of first point on the x-axis.]], }, { name = "y1", type = "number", description = [[The position of first point on the y-axis.]], }, { name = "x2", type = "number", description = [[The position of second point on the x-axis.]], }, { name = "y2", type = "number", description = [[The position of second point on the y-axis.]], }, { name = "...", type = "number", description = [[You can continue passing point positions to draw a polyline.]], }, }, }, { prefix = "love.graphics.", name = "polygon", description = [[Draw a polygon. Following the mode argument, this function can accept multiple numeric arguments or a single table of numeric arguments. In either case the arguments are interpreted as alternating x and y coordinates of the polygon's vertices. When in fill mode, the polygon must be convex and simple or rendering artifacts may occur.]], arguments = { { name = "mode", type = "string", description = [[How to draw the polygon.]], options = {"'fill'", "'line'"} }, { name = "...", type = "number", description = [[The vertices of the polygon.]], }, }, }, { prefix = "love.graphics.", name = "rectangle", description = [[Draws a rectangle.]], arguments = { { name = "mode", type = "string", description = [[How to draw the rectangle.]], options = {"'fill'", "'line'"} }, { name = "x", type = "number", description = [[The position of top-left corner along x-axis.]], }, { name = "y", type = "number", description = [[The position of top-left corner along y-axis.]], }, { name = "width", type = "number", description = [[Width of the rectangle.]], }, { name = "height", type = "number", description = [[Height of the rectangle.]], }, }, }, { prefix = "love.graphics.", name = "circle", description = [[Draws a circle.]], arguments = { { name = "mode", type = "string", description = [[How to draw the circle.]], options = {"'fill'", "'line'"} }, { name = "x", type = "number", description = [[The position of the center along x-axis.]], }, { name = "y", type = "number", description = [[The position of the center along y-axis.]], }, { name = "radius", type = "number", description = [[The radius of the circle.]], }, { name = "segments", type = "number", description = [[The number of segments used for drawing the circle.]], default = [[max(radius, 10)]]}, }, }, { prefix = "love.graphics.", name = "arc", description = [[Draws an arc.]], arguments = { { name = "mode", type = "string", description = [[How to draw the arc.]], options = {"'fill'", "'line'"} }, { name = "x", type = "number", description = [[The position of the center along x-axis.]], }, { name = "y", type = "number", description = [[The position of the center along y-axis.]], }, { name = "radius", type = "number", description = [[Radius of the arc.]], }, { name = "angle1", type = "number", description = [[The angle at which the arc begins.]], }, { name = "angle2", type = "number", description = [[The angle at which the arc terminates.]], }, { name = "segments", type = "number", description = [[The number of segments used for drawing the arc.]], default = [[10]]}, }, }, { prefix = "love.graphics.", name = "point", description = [[Draws a point. The pixel grid is actually offset to the center of each pixel. So to get clean pixels drawn use 0.5 + integer increments.]], arguments = { { name = "x", type = "number", description = [[The position on the x-axis.]], }, { name = "y", type = "number", description = [[The position on the y-axis.]], }, }, }, '### Line state', { prefix = "love.graphics.", name = "setLine", description = [[Sets the line width and style.]], arguments = { { name = "width", type = "number", description = [[The width of the line.]], }, { name = "style", type = "string", description = [[The LineStyle to use.]], default = [['smooth']], options = {"'smooth'", "'rough'"}}, }, }, { prefix = "love.graphics.", name = "get/setLineWidth", description = [[Gets/sets the line width.]], arguments = { { name = "width", type = "number", description = [[The width of the line.]], }, }, }, { prefix = "love.graphics.", name = "get/setLineStyle", description = [[Gets/sets the line style.]], arguments = { { name = "style", type = "string", description = [[The LineStyle to use.]], options = {"'smooth'", "'rough'"} }, }, }, '### Point state', { prefix = "love.graphics.", name = "setPoint", description = [[Sets the point size and style.]], arguments = { { name = "size", type = "number", description = [[The new point size.]], }, { name = "style", type = "string", description = [[The new point style.]], options = {"'smooth'", "'rough'"} }, }, }, { prefix = "love.graphics.", name = "get/setPointSize", description = [[Gets/sets the point size.]], arguments = { { name = "size", type = "number", description = [[The new point size.]], }, }, }, { prefix = "love.graphics.", name = "get/setPointStyle", description = [[Gets/sets the point style.]], arguments = { { name = "style", type = "string", description = [[The new point style.]], options = {"'smooth'", "'rough'"} }, }, }, { prefix = "love.graphics.", name = "getMaxPointSize", description = [[Gets the max supported point size.]], returns = { { name = "size", type = "number", description = [[The max supported point size.]], }, }, }, '## Color', { prefix = "love.graphics.", name = "get/setColor", description = [[Gets/sets the color used for drawing.]], arguments = { { name = "red", type = "number", description = [[The amount of red.]], }, { name = "green", type = "number", description = [[The amount of green.]], }, { name = "blue", type = "number", description = [[The amount of blue.]], }, { name = "alpha", type = "number", description = [[The amount of alpha.]], default = [[255]]}, }, }, { prefix = "love.graphics.", name = "get/setColorMode", description = [[Gets/sets the color mode (which controls how images are affected by the current color).]], arguments = { { name = "mode", type = "string", description = [[The color mode to use.]], options = {"'modulate'", "'replace'", "'combine'"} }, }, }, { prefix = "love.graphics.", name = "get/setBackgroundColor", description = [[Gets/sets the background color.]], arguments = { { name = "red", type = "number", description = [[The red component (0-255).]], }, { name = "green", type = "number", description = [[The green component (0-255).]], }, { name = "blue", type = "number", description = [[The blue component (0-255).]], }, { name = "alpha", type = "number", description = [[The alpha component (0-255).]], default = [[255]]}, }, }, '## Blending', { prefix = "love.graphics.", name = "get/setBlendMode", description = [[Gets/sets the blending mode.]], arguments = { { name = "mode", type = "string", description = [[The blend mode to use.]], options = {"'alpha'", "'additive'", "'subtractive'", "'multiplicative'", "'premultiplied'"} }, }, }, '## Draw region', { prefix = "love.graphics.", name = "get/setScissor", description = [[Gets/sets or disables scissor. The scissor limits the drawing area to a specified rectangle. This affects all graphics calls, including love.graphics.clear.]], arguments = { { name = "x", type = "number", description = [[The X coordinate of upper left corner.]] }, { name = "y", type = "number", description = [[The Y coordinate of upper left corner.]] }, { name = "width", type = "number", description = [[The width of clipping rectangle.]] }, { name = "height", type = "number", description = [[The height of clipping rectangle.]] }, }, }, { prefix = "love.graphics.", name = "setStencil", description = [[Defines or releases a stencil for the drawing operations. The passed function draws to the stencil instead of the screen, creating an image with transparent and opaque pixels. While active, it is used to test where pixels will be drawn or discarded. Calling the function without arguments releases the active stencil. When called without arguments, the active stencil is released.]], arguments = { { name = "function", type = "function", description = [[Function that draws the stencil.]] }, }, }, { prefix = "love.graphics.", name = "setInvertedStencil", description = [[Defines an inverted stencil for the drawing operations or releases the active one. It's the same as love.graphics.setStencil with the mask inverted. Calling the function without arguments releases the active stencil.]], arguments = { { name = "function", type = "function", description = [[Function that draws the stencil.]] }, }, }, '## Coordinate system', { prefix = "love.graphics.", name = "translate", description = [[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.graphics.clear is called (which is called automatically before love.draw in the default love.run function), or a love.graphics.pop reverts to a previous coordinate system state. Translating using whole numbers will prevent tearing/blurring of images and fonts draw after translating.]], arguments = { { name = "dx", type = "number", description = [[The translation relative to the x-axis.]], }, { name = "dy", type = "number", description = [[The translation relative to the y-axis.]], }, }, }, { prefix = "love.graphics.", name = "rotate", description = [[Rotates the coordinate system in two dimensions. Calling this function affects all future drawing operations by rotating the coordinate system around the origin by the given amount of radians. This change lasts until love.draw exits.]], arguments = { { name = "angle", type = "number", description = [[The amount to rotate the coordinate system in radians.]], }, }, }, { prefix = "love.graphics.", name = "scale", description = [[Scales the coordinate system in two dimensions. By default the coordinate system in LÖVE corresponds to the display pixels in horizontal and vertical directions one-to-one, and the x-axis increases towards the right while the y-axis increases downwards. Scaling the coordinate system changes this relation. After scaling by sx and sy, all coordinates are treated as if they were multiplied by sx and sy. Every result of a drawing operation is also correspondingly scaled, so scaling by (2, 2) for example would mean making everything twice as large in both x- and y-directions. Scaling by a negative value flips the coordinate system in the corresponding direction, which also means everything will be drawn flipped or upside down, or both. Scaling by zero is not a useful operation. Scale and translate are not commutative operations, therefore, calling them in different orders will change the outcome. Scaling lasts until love.draw exits.]], arguments = { { name = "sx", type = "number", description = [[The scaling in the direction of the x-axis.]], }, { name = "sy", type = "number", description = [[The scaling in the direction of the y-axis. If omitted, it defaults to same as parameter sx.]], default = [[sx]]}, }, }, { prefix = "love.graphics.", name = "shear", description = [[Shears the coordinate system.]], arguments = { { name = "kx", type = "number", description = [[The shear factor on the x-axis.]], }, { name = "ky", type = "number", description = [[The shear factor on the y-axis.]], }, }, }, '### Stack', { prefix = "love.graphics.", name = "push", description = [[Copies and pushes the current coordinate transformation to the transformation stack. This function is always used to prepare for a corresponding pop operation later. It stores the current coordinate transformation state into the transformation stack and keeps it active. Later changes to the transformation can be undone by using the pop operation, which returns the coordinate transform to the state it was in before calling push.]], }, { prefix = "love.graphics.", name = "pop", description = [[Pops the current coordinate transformation from the transformation stack. This function is always used to reverse a previous push operation. It returns the current transformation state to what it was before the last preceding push. For an example, see the description of love.graphics.push.]], }, '## Image', { prefix = "love.graphics.", name = "newImage", description = [[Creates a new Image from a filepath or an opened File or an ImageData.]], arguments = { { name = "path/File/ImageData", type = "string", description = [[The filepath to the image file.]], }, }, returns = { { name = "Image", type = "object", description = [[An Image object which can be drawn on screen.]], }, }, }, { prefix = "Image:", name = "getWidth/Height", description = [[Gets the width or height of the Image.]], returns = { { name = "pixels", type = "number", description = [[The width or height of the Image, in pixels.]], }, }, }, { prefix = "Image:", name = "get/setFilter", description = [[Gets/sets the filter mode for an image.]], arguments = { { name = "minify", type = "string", description = [[How to scale an image down.]], options = {"'linear'", "'nearest'"}}, { name = "magnify", type = "string", description = [[How to scale an image up.]], options = {"'linear'", "'nearest'"}}, }, }, { prefix = "love.graphics.", name = "get/setDefaultImageFilter", description = [[Gets/sets the default scaling filters.]], arguments = { { name = "minify", type = "string", description = [[Filter mode used when scaling the image down.]], options = {"'linear'", "'nearest'"}}, { name = "magnify", type = "string", description = [[Filter mode used when scaling the image up.]], options = {"'linear'", "'nearest'"}}, }, }, { prefix = "Image:", name = "get/setWrap", description = [[Gets/sets the wrapping properties of an Image. This function sets the way an Image is repeated when it is drawn with a Quad that is larger than the image's extent. An image may be clamped or set to repeat in both horizontal and vertical directions. Clamped images appear only once, but repeated ones repeat as many times as there is room in the Quad. N.B. If you use a Quad that is larger than the image extent and do not use repeated tiling, there may be an unwanted visual effect of the image stretching all the way to fill the Quad. If this is the case, setting Image:getWrap("repeat", "repeat") for all the images to be repeated, and using Quads of appropriate size will result in the best visual appearance.]], arguments = { { name = "horizontal", type = "string", description = [[Horizontal wrapping mode of the image.]], options = {"'clamp'", "'repeat'"}}, { name = "vertical", type = "string", description = [[Vertical wrapping mode of the image.]], options = {"'clamp'", "'repeat'"}}, }, }, '## Quad', { prefix = "love.graphics.", name = "newQuad", description = [[Creates a new Quad. The purpose of a Quad is to describe the result of the following transformation on any drawable object. The object is first scaled to dimensions sw * sh. The Quad then describes the rectangular area of dimensions width * height whose upper left corner is at position (x, y) inside the scaled object.]], arguments = { { name = "x", type = "number", description = [[The top-left position along the x-axis.]], }, { name = "y", type = "number", description = [[The top-left position along the y-axis.]], }, { name = "width", type = "number", description = [[The width of the Quad.]], }, { name = "height", type = "number", description = [[The height of the Quad.]], }, { name = "sw", type = "number", description = [[The reference width, the width of the Image.]], }, { name = "sh", type = "number", description = [[The reference height, the height of the Image.]], }, }, returns = { { name = "Quad", type = "object", description = [[The new Quad.]], }, }, }, { prefix = "Quad:", name = "get/setViewport", description = [[Gets/sets the texture coordinates according to a viewport.]], arguments = { { name = "x", type = "number", description = [[The top-left corner along the x-axis.]], }, { name = "y", type = "number", description = [[The top-right corner along the y-axis.]], }, { name = "width", type = "number", description = [[The width of the viewport.]], }, { name = "height", type = "number", description = [[The height of the viewport.]], }, }, }, { prefix = "Quad:", name = "flip", description = [[Flips this quad horizontally, vertically, or both.]], arguments = { { name = "x", type = "boolean", description = [[True to flip horizontally, false to leave as-is.]], }, { name = "y", type = "boolean", description = [[True to flip vertically, false to leave as-is.]], }, }, }, '## Canvas', { prefix = "love.graphics.", name = "newCanvas", description = [[Creates a new Canvas object for offscreen rendering.]], arguments = { { name = "width", type = "number", description = [[The width of the Canvas.]], default = [[screen width]]}, { name = "height", type = "number", description = [[The height of the Canvas.]], default = [[screen height]]}, }, returns = { { name = "Canvas", type = "object", description = [[A new Canvas object.]], }, }, }, { prefix = "Canvas:", name = "getWidth/Height", description = [[Gets the width/height of the Canvas.]], returns = { { name = "pixels", type = "number", description = [[The width/height of the Canvas, in pixels.]], }, }, }, { prefix = "love.graphics.", name = "get/setCanvas", description = [[Gets/sets the render target to a specified Canvas. All drawing operations until the next love.graphics.setCanvas call will be redirected to the Canvas and not shown on the screen. When called without arguments, the render target is reset to the screen.]], }, { prefix = "Canvas:", name = "renderTo", description = [[Render to the Canvas using a function.]], arguments = { { name = "function", type = "function", description = [[A function performing drawing operations.]], }, }, }, { prefix = "Canvas:", name = "clear", description = [[Clears content of a Canvas. When called without arguments, the Canvas will be cleared with color rgba = {0,0,0,0}, i.e. it will be fully transparent. If called with color parameters (be it numbers or a color table), the alpha component may be omitted in which case it defaults to 255 (fully opaque).]], arguments = { { name = "red", type = "number", description = [[Red component of the clear color (0-255).]], }, { name = "green", type = "number", description = [[Green component of the clear color (0-255).]], }, { name = "blue", type = "number", description = [[Blue component of the clear color (0-255).]], }, { name = "alpha", type = "number", description = [[Alpha component of the clear color (0-255).]], default = [[255]]}, }, }, { prefix = "Canvas:", name = "getImageData", description = [[Returns the image data stored in the Canvas. Think of it as taking a screenshot of the hidden screen that is the Canvas.]], returns = { { name = "ImageData", type = "object", description = [[The image data stored in the Canvas.]], }, }, }, { prefix = "Canvas:", name = "get/setFilter", description = [[Gets/sets the filter of the Canvas.]], arguments = { { name = "minify", type = "string", description = [[How to scale a canvas down.]], options = {"'linear'", "'nearest'"} }, { name = "magnify", type = "string", description = [[How to scale a canvas up.]], options = {"'linear'", "'nearest'"} }, }, }, { prefix = "Canvas:", name = "get/setWrap", description = [[Gets/sets the wrapping properties of a Canvas. This function sets the way the edges of a Canvas are treated if it is scaled or rotated. If the WrapMode is set to "clamp", the edge will not be interpolated. If set to "repeat", the edge will be interpolated with the pixels on the opposing side of the framebuffer.]], arguments = { { name = "horizontal", type = "string", description = [[Horizontal wrapping mode of the Canvas.]], options = {"'clamp'", "'repeat'"}}, { name = "vertical", type = "string", description = [[Vertical wrapping mode of the Canvas.]], options = {"'clamp'", "'repeat'"}}, }, }, '## SpriteBatch', { prefix = "love.graphics.", name = "newSpriteBatch", description = [[Creates a new SpriteBatch object.]], arguments = { { name = "Image", type = "object", description = [[The Image to use for the sprites.]], }, { name = "size", type = "number", description = [[The max number of sprites.]], default = [[1000]]}, { name = "usage", type = "string", description = [[The expected usage of the SpriteBatch.]], default = [['dynamic']], options = {"'dynamic'", "'static'", "'stream'"}}, }, returns = { { name = "SpriteBatch", type = "object", description = [[The new SpriteBatch.]], }, }, }, { prefix = "SpriteBatch:", name = "get/setImage", description = [[Replaces the image used for the sprites.]], arguments = { { name = "Image", type = "object", description = [[The new Image to use for the sprites.]], }, }, }, { prefix = "SpriteBatch:", name = "add", description = [[Add a sprite to the batch.]], arguments = { { name = "x", type = "number", description = [[The position to draw the object (x-axis).]], }, { name = "y", type = "number", description = [[The position to draw the object (y-axis).]], }, { name = "r", type = "number", description = [[Orientation (radians).]], default = [[0]]}, { name = "sx", type = "number", description = [[Scale factor (x-axis).]], default = [[1]]}, { name = "sy", type = "number", description = [[Scale factor (y-axis).]], default = [[sx]]}, { name = "ox", type = "number", description = [[Origin offset (x-axis).]], default = [[0]]}, { name = "oy", type = "number", description = [[Origin offset (y-axis).]], default = [[0]]}, { name = "kx", type = "number", description = [[Shear factor (x-axis).]], default = [[0]]}, { name = "ky", type = "number", description = [[Shear factor (y-axis).]], default = [[0]]}, }, returns = { { name = "id", type = "number", description = [[An identifier for the added sprite.]], }, }, }, { prefix = "SpriteBatch:", name = "addq", description = [[Add a Quad to the batch.]], arguments = { { name = "Quad", type = "object", description = [[The Quad to add.]], }, { name = "x", type = "number", description = [[The position to draw the object (x-axis).]], }, { name = "y", type = "number", description = [[The position to draw the object (y-axis).]], }, { name = "r", type = "number", description = [[Orientation (radians).]], default = [[0]]}, { name = "sx", type = "number", description = [[Scale factor (x-axis).]], default = [[1]]}, { name = "sy", type = "number", description = [[Scale factor (y-axis).]], default = [[sx]]}, { name = "ox", type = "number", description = [[Origin offset (x-axis).]], default = [[0]]}, { name = "oy", type = "number", description = [[Origin offset (y-axis).]], default = [[0]]}, { name = "kx", type = "number", description = [[Shear factor (x-axis).]], default = [[0]]}, { name = "ky", type = "number", description = [[Shear factor (y-axis).]], default = [[0]]}, }, returns = { { name = "id", type = "number", description = [[An identifier for the added sprite.]], }, }, }, { prefix = "SpriteBatch:", name = "set", description = [[Changes a sprite in the batch. This requires the identifier returned by add and addq.]], arguments = { { name = "id", type = "number", description = [[The identifier of the sprite that will be changed.]], }, { name = "x", type = "number", description = [[The position to draw the object (x-axis).]], }, { name = "y", type = "number", description = [[The position to draw the object (y-axis).]], }, { name = "r", type = "number", description = [[Orientation (radians).]], default = [[0]]}, { name = "sx", type = "number", description = [[Scale factor (x-axis).]], default = [[1]]}, { name = "sy", type = "number", description = [[Scale factor (y-axis).]], default = [[sx]]}, { name = "ox", type = "number", description = [[Origin offset (x-axis).]], default = [[0]]}, { name = "oy", type = "number", description = [[Origin offset (y-axis).]], default = [[0]]}, { name = "kx", type = "number", description = [[Shear factor (x-axis).]], default = [[0]]}, { name = "ky", type = "number", description = [[Shear factor (y-axis).]], default = [[0]]}, }, }, { prefix = "SpriteBatch:", name = "setColor", description = [[Sets the color that will be used for the next add and set operations. Calling the function without arguments will clear the color. The global color set with love.graphics.setColor will not work on the SpriteBatch if any of the sprites has its own color.]], }, { prefix = "SpriteBatch:", name = "setq", description = [[Changes a sprite with a quad in the batch. This requires the identifier returned by add and addq.]], arguments = { { name = "id", type = "number", description = [[The identifier of the sprite that will be changed.]], }, { name = "Quad", type = "object", description = [[The quad used on the image of the batch.]], }, { name = "x", type = "number", description = [[The position to draw the object (x-axis).]], }, { name = "y", type = "number", description = [[The position to draw the object (y-axis).]], }, { name = "r", type = "number", description = [[Orientation (radians).]], default = [[0]]}, { name = "sx", type = "number", description = [[Scale factor (x-axis).]], default = [[1]]}, { name = "sy", type = "number", description = [[Scale factor (y-axis).]], default = [[sx]]}, { name = "ox", type = "number", description = [[Origin offset (x-axis).]], default = [[0]]}, { name = "oy", type = "number", description = [[Origin offset (y-axis).]], default = [[0]]}, { name = "kx", type = "number", description = [[Shear factor (x-axis).]], default = [[0]]}, { name = "ky", type = "number", description = [[Shear factor (y-axis).]], default = [[0]]}, }, returns = { { name = "id", type = "number", description = [[An identifier for the added sprite.]], }, }, }, { prefix = "SpriteBatch:", name = "clear", description = [[Removes all sprites from the buffer.]], }, { prefix = "SpriteBatch:", name = "bind", description = [[Binds the SpriteBatch to the memory. Binding a SpriteBatch before updating its content can improve the performance as it doesn't push each update to the graphics card separately. Don't forget to unbind the SpriteBatch or the updates won't show up.]], }, { prefix = "SpriteBatch:", name = "unbind", description = [[Unbinds the SpriteBatch.]], }, '## ParticleSystem', { prefix = "love.graphics.", name = "newParticleSystem", description = [[Creates a new ParticleSystem.]], arguments = { { name = "Image", type = "object", description = [[The image object.]], }, { name = "buffer", type = "number", description = [[The max number of particles at the same time.]], }, }, returns = { { name = "ParticleSystem", type = "object", description = [[A new ParticleSystem.]], }, }, }, { prefix = "ParticleSystem:", name = "setSprite", description = [[Sets the image which is to be emitted.]], arguments = { { name = "Image", type = "object", description = [[An Image to use for the particle.]], }, }, }, { prefix = "ParticleSystem:", name = "setBufferSize", description = [[Sets the size of the buffer (the max allowed amount of particles in the system).]], arguments = { { name = "buffer", type = "number", description = [[The buffer size.]], }, }, }, { prefix = "ParticleSystem:", name = "update", description = [[Updates the particle system; moving, creating and killing particles.]], arguments = { { name = "dt", type = "number", description = [[The time (seconds) since last frame.]], }, }, }, '### Controls', { prefix = "ParticleSystem:", name = "start", description = [[Starts the particle emitter.]], }, { prefix = "ParticleSystem:", name = "stop", description = [[Stops the particle emitter, resetting the lifetime counter.]], }, { prefix = "ParticleSystem:", name = "pause", description = [[Pauses the particle emitter.]], }, { prefix = "ParticleSystem:", name = "reset", description = [[Resets the particle emitter, removing any existing particles and resetting the lifetime counter.]], }, '### Emitter', { prefix = "ParticleSystem:", name = "get/setPosition", description = [[Gets/sets the position of the emitter.]], arguments = { { name = "x", type = "number", description = [[Position along x-axis.]], }, { name = "y", type = "number", description = [[Position along y-axis.]], }, }, }, { prefix = "ParticleSystem:", name = "setLifetime", description = [[Sets how long the particle system should emit particles (if -1 then it emits particles forever).]], arguments = { { name = "life", type = "number", description = [[The lifetime of the emitter (in seconds).]], }, }, }, { prefix = "ParticleSystem:", name = "setEmissionRate", description = [[Sets the amount of particles emitted per second.]], arguments = { { name = "rate", type = "number", description = [[The amount of particles per second.]], }, }, }, { prefix = "ParticleSystem:", name = "get/setDirection", description = [[Gets/sets the direction the particles will be emitted in.]], arguments = { { name = "direction", type = "number", description = [[The direction of the particles (in radians).]], }, }, }, { prefix = "ParticleSystem:", name = "get/setSpread", description = [[Gets/sets the amount of spread for the system.]], arguments = { { name = "spread", type = "number", description = [[The amount of spread (radians).]], }, }, }, '### Particles', { prefix = "ParticleSystem:", name = "setParticleLife", description = [[Sets the life of the particles.]], arguments = { { name = "min", type = "number", description = [[The minimum life of the particles (seconds).]], }, { name = "max", type = "number", description = [[The maximum life of the particles (seconds).]], default = [[min]]}, }, }, { prefix = "ParticleSystem:", name = "setColors", description = [[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. Color modulation needs to be activated for this function to have any effect. Arguments are passed in groups of four, representing the components of the desired RGBA value. At least one color must be specified. A maximum of eight may be used.]], arguments = { { name = "r1", type = "number", description = [[First color, red component (0-255).]], }, { name = "g1", type = "number", description = [[First color, green component (0-255).]], }, { name = "b1", type = "number", description = [[First color, blue component (0-255).]], }, { name = "a1", type = "number", description = [[First color, alpha component (0-255).]], }, { name = "r2", type = "number", description = [[Second color, red component (0-255).]], }, { name = "g2", type = "number", description = [[Second color, green component (0-255).]], }, { name = "b2", type = "number", description = [[Second color, blue component (0-255).]], }, { name = "a2", type = "number", description = [[Second color, alpha component (0-255).]], }, { name = "...", type = "number", description = [[Etc.]], }, }, }, { prefix = "ParticleSystem:", name = "setSizes", description = [[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.]], arguments = { { name = "size1", type = "number", description = [[The first size.]], }, { name = "size2", type = "number", description = [[The second size.]], }, { name = "...", type = "number", description = [[Etc.]], }, }, }, { prefix = "ParticleSystem:", name = "setSizeVariation", description = [[Sets the degree of variation (0 meaning no variation and 1 meaning full variation between start and end).]], arguments = { { name = "variation", type = "number", description = [[The degree of variation (0 meaning no variation and 1 meaning full variation between start and end).]], }, }, }, '### Particle speed', { prefix = "ParticleSystem:", name = "setSpeed", description = [[Sets the speed of the particles.]], arguments = { { name = "min", type = "number", description = [[The minimum linear speed of the particles.]], }, { name = "max", type = "number", description = [[The maximum linear speed of the particles.]], default = [[min]]}, }, }, { prefix = "ParticleSystem:", name = "setGravity", description = [[Sets the gravity affecting the particles (acceleration along the y-axis). Every particle created will have a gravity between min and max.]], arguments = { { name = "min", type = "number", description = [[The minimum gravity.]], }, { name = "max", type = "number", description = [[The maximum gravity.]], default = [[min]]}, }, }, { prefix = "ParticleSystem:", name = "setRadialAcceleration", description = [[Set the radial acceleration (away from the emitter).]], arguments = { { name = "min", type = "number", description = [[The minimum acceleration.]], }, { name = "max", type = "number", description = [[The maximum acceleration.]], default = [[min]]}, }, }, { prefix = "ParticleSystem:", name = "setTangentialAcceleration", description = [[Sets the tangential acceleration (acceleration perpendicular to the particle's direction).]], arguments = { { name = "min", type = "number", description = [[The minimum acceleration.]], }, { name = "max", type = "number", description = [[The maximum acceleration.]], default = [[min]]}, }, }, '### Particle rotation', { prefix = "ParticleSystem:", name = "setRotation", description = [[Sets the rotation of the image upon particle creation (in radians).]], arguments = { { name = "min", type = "number", description = [[The minimum initial angle (radians).]], }, { name = "max", type = "number", description = [[The maximum initial angle (radians).]], default = [[min]]}, }, }, { prefix = "ParticleSystem:", name = "setSpin", description = [[Sets the spin of the sprite.]], arguments = { { name = "min", type = "number", description = [[The minimum spin (radians per second).]], }, { name = "max", type = "number", description = [[The maximum spin (radians per second).]], default = [[min]]}, { name = "variation", type = "number", description = [[The degree of variation (0 meaning no variation and 1 meaning full variation between start and end).]], default = [[0]]}, }, }, { prefix = "ParticleSystem:", name = "setSpinVariation", description = [[Sets the degree of variation (0 meaning no variation and 1 meaning full variation between start and end).]], arguments = { { name = "variation", type = "number", description = [[The degree of variation (0 meaning no variation and 1 meaning full variation between start and end).]], }, }, }, { prefix = "ParticleSystem:", name = "setOffset", description = [[Set the offset position which the particle sprite is rotated around. If this function is not used, the particles rotate around their center.]], arguments = { { name = "x", type = "number", description = [[The x coordinate of the rotation offset.]], }, { name = "y", type = "number", description = [[The y coordinate of the rotation offset.]], }, }, }, '### State', { prefix = "ParticleSystem:", name = "count", description = [[Gets the amount of particles that are currently in the system.]], returns = { { name = "count", type = "number", description = [[The current number of live particles.]], }, }, }, { prefix = "ParticleSystem:", name = "isActive", description = [[Checks whether the particle system is actively emitting particles.]], returns = { { name = "active", type = "boolean", description = [[True if system is active, false otherwise.]], }, }, }, { prefix = "ParticleSystem:", name = "isEmpty", description = [[Checks whether the particle system is empty of particles.]], returns = { { name = "empty", type = "boolean", description = [[True if there are no live particles, false otherwise.]], }, }, }, { prefix = "ParticleSystem:", name = "isFull", description = [[Checks whether the particle system is full of particles.]], returns = { { name = "full", type = "boolean", description = [[True if no more particles can be added, false otherwise.]], }, }, }, '## PixelEffect', { prefix = "love.graphics.", name = "newPixelEffect", description = [[Creates a new PixelEffect object for hardware-accelerated pixel level effects. A PixelEffect contains at least one function, named effect, which is the effect itself, but it can contain additional functions. vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords )]], arguments = { { name = "code", type = "string", description = [[The pixel effect code.]], }, }, returns = { { name = "PixelEffect", type = "object", description = [[A PixelEffect object for use in drawing operations.]], }, }, }, { prefix = "love.graphics.", name = "get/setPixelEffect", description = [[Gets/sets or resets a PixelEffect as the current pixel effect. All drawing operations until the next love.graphics.setPixelEffect will be drawn using the PixelEffect object specified. When called without arguments, pixel effects are disabled, allowing unfiltered drawing operations.]], arguments = { { name = "PixelEffect", type = "object", description = [[The pixel effect.]], }, }, }, { prefix = "PixelEffect:", name = "send", description = [[Sends one or more values to a pixel effect using the specified name. This function allows certain aspects of a pixel effect to be controlled by Lua code.]], arguments = { { name = "name", type = "string", description = [[Name of the value to send to the pixel effect.]], }, { name = "value", type = "value", description = [[Value to send to the pixel effect.]], }, }, }, { prefix = "PixelEffect:", name = "getWarnings", description = [[Returns any warning messages from compiling the pixel effect code. This can be used for debugging your pixel effects if there's anything the graphics hardware doesn't like.]], returns = { { name = "warnings", type = "string", description = [[Warning messages (if any).]], }, }, }, '## ImageData', { prefix = "love.image.", name = "newImageData", description = [[Create a new ImageData object.]], arguments = { { name = "path/File/FileData", type = "string", description = [[The file of the image.]], }, }, returns = { { name = "ImageData", type = "object", description = [[The new ImageData object.]], }, }, }, { prefix = "love.image.", name = "newImageData", description = [[Create a new ImageData object.]], arguments = { { name = "width", type = "number", description = [[The width of the ImageData.]], }, { name = "height", type = "number", description = [[The height of the ImageData.]], }, }, returns = { { name = "ImageData", type = "object", description = [[The new ImageData object.]], }, }, }, { prefix = "ImageData:", name = "getWidth/Height", description = [[Gets the width or height of the ImageData.]], returns = { { name = "pixels", type = "number", description = [[The width or height of the ImageData in pixels.]], }, }, }, { prefix = "ImageData:", name = "mapPixel", description = [[Transform an image by applying a function to every pixel. This function is a higher order function. It takes another function as a parameter, and calls it once for each pixel in the ImageData. The function parameter is called with six parameters for each pixel in turn. The parameters are numbers that represent the x and y coordinates of the pixel and its red, green, blue and alpha values. The function parameter can return up to four number values, which become the new r, g, b and a values of the pixel. If the function returns fewer values, the remaining components are set to 0.]], arguments = { { name = "function", type = "function", description = [[Function parameter to apply to every pixel.]], }, }, }, { prefix = "ImageData:", name = "paste", description = [[Paste into ImageData from another source ImageData.]], arguments = { { name = "ImageData", type = "object", description = [[Source ImageData from which to copy.]], }, { name = "dx", type = "number", description = [[Destination top-left position on x-axis.]], }, { name = "dy", type = "number", description = [[Destination top-left position on y-axis.]], }, { name = "sx", type = "number", description = [[Source top-left position on x-axis.]], }, { name = "sy", type = "number", description = [[Source top-left position on y-axis.]], }, { name = "sw", type = "number", description = [[Source width.]], }, { name = "sh", type = "number", description = [[Source height.]], }, }, }, { prefix = "ImageData:", name = "get/setPixel", description = [[Gets/sets the color of a pixel. Valid x and y values start at 0 and go up to image width and height minus 1.]], arguments = { { name = "x", type = "number", description = [[The position of the pixel on the x-axis.]], }, { name = "y", type = "number", description = [[The position of the pixel on the y-axis.]], }, { name = "red", type = "number", description = [[The red component (0-255).]], }, { name = "green", type = "number", description = [[The green component (0-255).]], }, { name = "blue", type = "number", description = [[The blue component (0-255).]], }, { name = "alpha", type = "number", description = [[The alpha component (0-255).]], }, }, }, { prefix = "ImageData:", name = "encode", description = [[Encodes the ImageData and writes it to the save directory.]], arguments = { { name = "filename", type = "string", description = [[Name of a file to write encoded data to. The format will be automatically deduced from the file extension.]], }, { name = "format", type = "string", description = [[The format to encode the image in.]], default = "Automatically deduced from the filename's extension.", options = {"'png'", "'bmp'", "'jpg'", "'tga'"}}, }, }, { prefix = "ImageData:", name = "getString", description = [[Gets the full ImageData as a string.]], returns = { { name = "pixels", type = "string", description = [[The raw data.]], }, }, }, '## Display', { prefix = "love.graphics.", name = "get/setMode", description = [[Changes the display mode. If width or height is 0, the width or height of the desktop will be used.]], arguments = { { name = "width", type = "number", description = [[Display width.]], default = "Screen width."}, { name = "height", type = "number", description = [[Display height.]], default = "Screen height."}, { name = "fullscreen", type = "boolean", description = [[Fullscreen (true) or windowed (false).]], default = [[false]]}, { name = "vsync", type = "boolean", description = [[True if LÖVE should wait for vsync, false otherwise.]], default = [[true]]}, { name = "fsaa", type = "number", description = [[The number of FSAA-buffers.]], default = [[0]]}, }, returns = { { name = "ok", type = "boolean", description = [[True if successful, false otherwise.]], }, }, }, { prefix = "love.graphics.", name = "getWidth/Height", description = [[Gets the width or height of the window.]], returns = { { name = "pixels", type = "number", description = [[The width or height of the window.]], }, }, }, { prefix = "love.graphics.", name = "toggleFullscreen", description = [[Toggles fullscreen.]], returns = { { name = "ok", type = "boolean", description = [[True if successful, false otherwise.]], }, }, }, { prefix = "love.graphics.", name = "hasFocus", description = [[Checks if the game window has keyboard focus.]], returns = { { name = "focus", type = "boolean", description = [[True if the window has the focus or false if not.]], }, }, }, { prefix = "love.graphics.", name = "isCreated", description = [[Checks if the window has been created.]], returns = { { name = "created", type = "boolean", description = [[True if the window has been created, false otherwise.]], }, }, }, '### Window', { prefix = "love.graphics.", name = "get/setCaption", description = [[Gets/sets the window caption.]], arguments = { { name = "caption", type = "string", description = [[The new window caption.]], }, }, }, { prefix = "love.graphics.", name = "setIcon", description = [[Set window icon. This feature is not completely supported on Windows (apparently an SDL bug, not a LÖVE bug).]], arguments = { { name = "Image", type = "object", description = [[The window icon.]], }, }, }, '### Support', { prefix = "love.graphics.", name = "getModes", description = [[Gets a list of supported fullscreen modes.]], returns = { { name = "modes", type = "table", description = [[A table of width/height pairs. (Note that this may not be in order.)]], }, }, }, { prefix = "love.graphics.", name = "checkMode", description = [[Checks if a display mode is supported.]], arguments = { { name = "width", type = "number", description = [[The display width.]], }, { name = "height", type = "number", description = [[The display height.]], }, { name = "fullscreen", type = "boolean", description = [[True to check for fullscreen, false for windowed.]], default = [[false]]}, }, returns = { { name = "supported", type = "boolean", description = [[True if supported, false if not.]], }, }, }, '## Miscellaneous', { prefix = "love.graphics.", name = "newScreenshot", description = [[Creates a screenshot and returns the image data.]], returns = { { name = "ImageData", type = "object", description = [[The image data of the screenshot.]], }, }, }, { prefix = "love.graphics.", name = "isSupported", description = [[Checks if certain graphics functions can be used. Older and low-end systems do not always support all graphics extensions.]], arguments = { { name = "...", type = "string", description = [[The graphics feature(s) to check for.]], options = {"'canvas'", "'pixeleffect'", "'npot'", "'subtractive'"}}, }, returns = { { name = "isSupported", type = "boolean", description = [[True if everything is supported, false otherwise.]], }, }, }, { prefix = "love.graphics.", name = "clear", description = [[Clears the screen to background color and restores the default coordinate system. This function is called automatically before love.draw in the default love.run function. See the example in love.run for a typical use of this function. Note that the scissor area bounds the cleared region.]], }, { prefix = "love.graphics.", name = "present", description = [[Displays the results of drawing operations on the screen. This function is used when writing your own love.run function. It presents all the results of your drawing operations on the screen. See the example in love.run for a typical use of this function.]], }, { prefix = "love.graphics.", name = "reset", description = [[Resets the current graphics settings. Calling reset makes the current drawing color white, the current background color black, resets any active Canvas or PixelEffect, and removes any scissor settings. It sets the BlendMode to alpha and ColorMode to modulate. It also sets both the point and line drawing modes to smooth and their sizes to 1.0.]], }, '# Audio', { prefix = "love.audio.", name = "getNumSources", description = [[Returns the number of sources which are currently playing or paused.]], returns = { { name = "numSources", type = "number", description = [[The number of sources which are currently playing or paused.]], }, }, }, { prefix = "love.audio.", name = "get/setVolume", description = [[Gets/sets the master volume.]], arguments = { { name = "volume", type = "number", description = [[1.0f is max and 0.0f is off.]], }, }, }, '## Source', { prefix = "love.audio.", name = "newSource", description = [[Creates a new Source from a file, SoundData, or Decoder. Sources created from SoundData are always static.]], arguments = { { name = "path/File/SoundData", type = "string", description = [[The filepath to create a Source from.]], }, { name = "type", type = "string", description = [[Streaming or static source.]], default = [['stream']], options = {"'stream'", "'static'"}}, }, returns = { { name = "Source", type = "object", description = [[A new Source that can play the specified audio.]], }, }, }, { prefix = "Source:", name = "isStatic", description = [[Returns whether the Source is static. See SourceType.static definition to have more informations.]], returns = { { name = "static", type = "boolean", description = [[True if the Source is static, false otherwise.]], }, }, }, { prefix = "Source:", name = "is/setLooping", description = [[Gets/sets whether the Source should loop.]], arguments = { { name = "loop", type = "boolean", description = [[True if the source should loop, false otherwise.]], }, }, }, { prefix = "Source:", name = "get/setVolume", description = [[Gets/sets the volume of the Source.]], arguments = { { name = "volume", type = "number", description = [[The volume of the Source, where 1.0 is normal volume.]], }, }, }, { prefix = "Source:", name = "get/setVolumeLimits", description = [[Gets/sets the volume limits of the source. The limits have to be numbers from 0 to 1.]], arguments = { { name = "min", type = "number", description = [[The minimum volume.]], }, { name = "max", type = "number", description = [[The maximum volume.]], }, }, }, { prefix = "Source:", name = "get/setPitch", description = [[Gets/sets the pitch of the Source.]], arguments = { { name = "pitch", type = "number", description = [[Calculated with regard to 1 being the base pitch. Each reduction by 50 percent equals a pitch shift of -12 semitones (one octave reduction). Each doubling equals a pitch shift of 12 semitones (one octave increase). Zero is not a legal value.]], }, }, }, { prefix = "Source:", name = "seek", description = [[Sets the playing position of the Source.]], arguments = { { name = "position", type = "number", description = [[The position to seek to.]], }, { name = "unit", type = "string", description = [[The unit of the position value.]], default = [['seconds']], options = {"'seconds'", "'samples'"}}, }, }, { prefix = "Source:", name = "tell", description = [[Gets the currently playing position of the Source.]], arguments = { { name = "unit", type = "string", description = [[The type of unit for the return value.]], default = [['seconds']], options = {"'seconds'", "'samples'"}}, }, returns = { { name = "position", type = "number", description = [[The currently playing position of the Source.]], }, }, }, '### Controls', { prefix = "love.audio.", name = "play", description = [[Plays the specified Source.]], arguments = { { name = "Source", type = "object", description = [[The Source to play.]], }, }, }, { prefix = "love.audio.", name = "stop", description = [[Stops the specified Source, or stops all Sources if no Source is given.]], arguments = { { name = "Source", type = "object", description = [[The Source to stop.]], }, }, }, { prefix = "love.audio.", name = "pause", description = [[Pauses the specified Source, or pauses all Sources if no Source is given.]], arguments = { { name = "Source", type = "object", description = [[The Source to pause.]], }, }, }, { prefix = "love.audio.", name = "resume", description = [[Resumes the specified Source, or resumes all Sources if no Source is given.]], arguments = { { name = "Source", type = "object", description = [[The Source to resume.]], }, }, }, { prefix = "love.audio.", name = "rewind", description = [[Rewinds the specified Source, or rewinds all Sources if no Source is given.]], arguments = { { name = "Source", type = "object", description = [[The Source to rewind.]], }, }, }, { prefix = "Source:", name = "play", description = [[Starts playing the Source.]], }, { prefix = "Source:", name = "stop", description = [[Stops a Source.]], }, { prefix = "Source:", name = "pause", description = [[Pauses the Source.]], }, { prefix = "Source:", name = "resume", description = [[Resumes a paused Source.]], }, { prefix = "Source:", name = "rewind", description = [[Rewinds a Source.]], }, '### State', { prefix = "Source:", name = "isPaused", description = [[Returns whether the Source is paused.]], returns = { { name = "paused", type = "boolean", description = [[True if the Source is paused, false otherwise.]], }, }, }, { prefix = "Source:", name = "isStopped", description = [[Returns whether the Source is stopped.]], returns = { { name = "stopped", type = "boolean", description = [[True if the Source is stopped, false otherwise.]], }, }, }, '### Spatial', { prefix = "Source:", name = "get/setPosition", description = [[Gets/sets the position of the Source.]], arguments = { { name = "x", type = "number", description = [[The X position of the Source.]], }, { name = "y", type = "number", description = [[The Y position of the Source.]], }, { name = "z", type = "number", description = [[The Z position of the Source.]], }, }, }, { prefix = "Source:", name = "get/setVelocity", description = [[Gets/sets the velocity of the Source. This does not change the position of the Source, but is used to calculate the doppler effect.]], arguments = { { name = "x", type = "number", description = [[The X part of the velocity vector.]], }, { name = "y", type = "number", description = [[The Y part of the velocity vector.]], }, { name = "z", type = "number", description = [[The Z part of the velocity vector.]], }, }, }, --[=[ { prefix = "Source:", name = "get/setDirection", description = [[Gets/sets the direction vector of the Source. A zero vector makes the source non-directional.]], arguments = { { name = "x", type = "number", description = [[The X part of the direction vector.]], }, { name = "y", type = "number", description = [[The Y part of the direction vector.]], }, { name = "z", type = "number", description = [[The Z part of the direction vector.]], }, }, }, ]=] { prefix = "Source:", name = "get/setRolloff", description = [[Gets/sets the rolloff factor.]], arguments = { { name = "rolloff", type = "number", description = [[The new rolloff factor.]], }, }, }, { prefix = "Source:", name = "get/setDistance", description = [[Gets/sets the reference and maximum distance of the source.]], arguments = { { name = "ref", type = "number", description = [[The new reference distance.]], }, { name = "max", type = "number", description = [[The new maximum distance.]], }, }, }, '### Listener', { prefix = "love.audio.", name = "get/setPosition", description = [[Gets/sets the position of the listener, which determines how sounds play.]], arguments = { { name = "x", type = "number", description = [[The X position of the listener.]], }, { name = "y", type = "number", description = [[The Y position of the listener.]], }, { name = "z", type = "number", description = [[The Z position of the listener.]], }, }, }, { prefix = "love.audio.", name = "get/setVelocity", description = [[Gets/sets the velocity of the listener.]], arguments = { { name = "x", type = "number", description = [[The X velocity of the listener.]], }, { name = "y", type = "number", description = [[The Y velocity of the listener.]], }, { name = "z", type = "number", description = [[The Z velocity of the listener.]], }, }, }, --[=[ { prefix = "love.audio.", name = "get/setOrientation", description = [[Gets/sets the orientation of the listener.]], arguments = { { name = "fx", type = "number", description = [[The X component of the forward vector of the listener orientation.]], }, { name = "fy", type = "number", description = [[The Y component of the forward vector of the listener orientation.]], }, { name = "fz", type = "number", description = [[The Z component of the forward vector of the listener orientation.]], }, { name = "ux", type = "number", description = [[The X component of the up vector of the listener orientation.]], }, { name = "uy", type = "number", description = [[The Y component of the up vector of the listener orientation.]], }, { name = "uz", type = "number", description = [[The Z component of the up vector of the listener orientation.]], }, }, }, ]=] { prefix = "love.audio.", name = "get/setDistanceModel", description = [[Gets/sets the distance attenuation model.]], arguments = { { name = "model", type = "string", description = [[The new distance model.]], options = {"'none'", "'inverse'", "'inverse clamped'", "'linear'", "'linear clamped'", "'exponent'", "'exponent clamped'", }}, }, }, '## SoundData', { prefix = "love.sound.", name = "newSoundData", description = [[Creates new SoundData from a Decoder or file. It's also possible to create SoundData with a custom sample rate, channel and bit depth. The sound data will be decoded to the memory in a raw format. It is recommended to create only short sounds like effects, as a 3 minute song uses 30 MB of memory this way.]], arguments = { { name = "path/File", type = "string", description = [[Decode data from this Decoder until EOF.]], }, }, returns = { { name = "SoundData", type = "object", description = [[A new SoundData object.]], }, }, }, { prefix = "love.sound.", name = "newSoundData", description = [[Creates new SoundData from a Decoder or file. It's also possible to create SoundData with a custom sample rate, channel and bit depth. The sound data will be decoded to the memory in a raw format. It is recommended to create only short sounds like effects, as a 3 minute song uses 30 MB of memory this way.]], arguments = { { name = "samples", type = "number", description = [[Total number of samples.]], }, { name = "rate", type = "number", description = [[Number of samples per second.]], default = "44100", }, { name = "bits", type = "number", description = [[Bits per sample.]], default = "16", options = {"8", "16"} }, { name = "channels", type = "number", description = [[Either 1 for mono or 2 for stereo.]], default = "2", options = {"1", "2"} }, }, returns = { { name = "SoundData", type = "object", description = [[A new SoundData object.]], }, }, }, { prefix = "SoundData:", name = "getSample", description = [[Gets the sample at the specified position.]], arguments = { { name = "i", type = "number", description = [[The position of the sample (0 means first sample).]], }, }, returns = { { name = "sample", type = "number", description = [[A normalized sample (range -1.0 to 1.0).]], }, } }, { prefix = "SoundData:", name = "setSample", description = [[Sets the sample at the specified position.]], arguments = { { name = "i", type = "number", description = [[The position of the sample (0 means first sample).]], }, { name = "sample", type = "number", description = [[A normalized sample (range -1.0 to 1.0).]], }, }, }, '### Info', { prefix = "SoundData:", name = "getBits", description = [[Returns the number of bits per sample.]], returns = { { name = "bits", type = "number", description = [[Either 8 or 16.]], }, }, }, { prefix = "SoundData:", name = "getChannels", description = [[Returns the number of channels in the stream.]], returns = { { name = "channels", type = "number", description = [[1 for mono, 2 for stereo.]], }, }, }, { prefix = "SoundData:", name = "getSampleRate", description = [[Returns the sample rate of the SoundData.]], returns = { { name = "rate", type = "number", description = [[Number of samples per second.]], }, }, }, --'# Input', '## Keyboard', { prefix = "love.keyboard.", name = "isDown", description = [[Checks whether a certain key is down. Not to be confused with love.keypressed or love.keyreleased.]], arguments = { { name = "key", type = "string", description = [[The key to check.]], }, }, returns = { { name = "down", type = "boolean", description = [[True if the key is down, false if not.]], }, }, }, { prefix = "love.keyboard.", name = "get/setKeyRepeat", description = [[Enables key repeating and sets the delay and interval.]], arguments = { { name = "delay", type = "number", description = [[The amount of time before repeating the key (in seconds). 0 disables key repeat.]], }, { name = "interval", type = "number", description = [[The amount of time between repeats (in seconds)]], }, }, }, '## Mouse', { prefix = "love.mouse.", name = "isDown", description = [[Checks whether a certain mouse button is down. This function does not detect mousewheel scrolling; you must use the love.mousepressed callback for that.]], arguments = { { name = "button", type = "string", description = [[The button to check.]], options = {"'l'", "'m'", "'r'", "'wd'", "'wu'", "'x1'", "'x2'", }}, }, returns = { { name = "down", type = "boolean", description = [[True if the specified button is down.]], }, }, }, { prefix = "love.mouse.", name = "get/setPosition", description = [[Gets/sets the position of the mouse.]], arguments = { { name = "x", type = "number", description = [[The new position of the mouse along the x-axis.]], }, { name = "y", type = "number", description = [[The new position of the mouse along the y-axis.]], }, }, }, { prefix = "love.mouse.", name = "getX/Y", description = [[Returns the current x or y position of the mouse.]], returns = { { name = "position", type = "number", description = [[The position of the mouse along the x or y-axis.]], }, }, }, { prefix = "love.mouse.", name = "isGrabbed/setGrab", description = [[Gets/sets whether the mouse is confined to the window.]], arguments = { { name = "grabbed", type = "boolean", description = [[True if the cursor is grabbed, false if it is not.]], }, }, }, { prefix = "love.mouse.", name = "is/setVisible", description = [[Gets/sets the visibility of the cursor.]], arguments = { { name = "visible", type = "boolean", description = [[True to set the cursor to visible, false to hide the cursor.]], }, }, }, '## Joystick', { prefix = "love.joystick.", name = "isDown", description = [[Checks if a button on a joystick is pressed.]], arguments = { { name = "joystick", type = "number", description = [[The joystick to be checked.]], }, { name = "button", type = "number", description = [[The button to be checked.]], }, }, returns = { { name = "down", type = "boolean", description = [[True if the button is down, false if it is not.]], }, }, }, { prefix = "love.joystick.", name = "getAxis", description = [[Returns the direction of the axis.]], arguments = { { name = "joystick", type = "number", description = [[The joystick to be checked.]], }, { name = "axis", type = "number", description = [[The axis to be checked.]], }, }, returns = { { name = "direction", type = "number", description = [[Current value of the axis.]], }, }, }, { prefix = "love.joystick.", name = "getAxes", description = [[Returns the position of each axis.]], arguments = { { name = "joystick", type = "number", description = [[The joystick to be checked.]], }, }, returns = { { name = "axisDirN", type = "number", description = [[Direction of axisN.]], }, }, }, { prefix = "love.joystick.", name = "getHat", description = [[Returns the direction of a hat.]], arguments = { { name = "joystick", type = "number", description = [[The joystick to be checked.]], }, { name = "hat", type = "number", description = [[The hat to be checked.]], }, }, returns = { { name = "direction", type = "string", description = [[The direction the hat is pushed.]], options = {"'lu'", "'u'", "'ru'", "'l'", "'c'", "'r'", "'ld'", "'d'", "'rd'", }}, }, }, { prefix = "love.joystick.", name = "getBall", description = [[Returns the change in ball position.]], arguments = { { name = "joystick", type = "number", description = [[The joystick to be checked.]], }, { name = "ball", type = "number", description = [[The ball to be checked.]], }, }, returns = { { name = "dx", type = "number", description = [[Change in x of the ball position.]], }, { name = "dy", type = "number", description = [[Change in y of the ball position.]], }, }, }, '### Info', { prefix = "love.joystick.", name = "getName", description = [[Returns the name of a joystick.]], arguments = { { name = "joystick", type = "number", description = [[The joystick to be checked.]], }, }, returns = { { name = "name", type = "string", description = [[The name of the joystick.]], }, }, }, { prefix = "love.joystick.", name = "getNumJoysticks", description = [[Returns how many joysticks are available.]], returns = { { name = "joysticks", type = "number", description = [[The number of joysticks available.]], }, }, }, { prefix = "love.joystick.", name = "getNumButtons", description = [[Returns the number of buttons on the joystick.]], arguments = { { name = "joystick", type = "number", description = [[The joystick to be checked.]], }, }, returns = { { name = "buttons", type = "number", description = [[The number of buttons available.]], }, }, }, { prefix = "love.joystick.", name = "getNumAxes", description = [[Returns the number of axes on the joystick.]], arguments = { { name = "joystick", type = "number", description = [[The joystick to be checked.]], }, }, returns = { { name = "axes", type = "number", description = [[The number of axes available.]], }, }, }, { prefix = "love.joystick.", name = "getNumHats", description = [[Returns the number of hats on the joystick.]], arguments = { { name = "joystick", type = "number", description = [[The joystick to be checked.]], }, }, returns = { { name = "hats", type = "number", description = [[How many hats the joystick has.]], }, }, }, { prefix = "love.joystick.", name = "getNumBalls", description = [[Returns the number of balls on the joystick.]], arguments = { { name = "joystick", type = "number", description = [[The joystick to be checked.]], }, }, returns = { { name = "balls", type = "number", description = [[The number of balls available.]], }, }, }, '# Filesystem', { prefix = "love.filesystem.", name = "read", description = [[Read the contents of a file.]], arguments = { { name = "name", type = "string", description = [[The name (and path) of the file.]], }, { name = "bytes", type = "number", description = [[How many bytes to read.]], default = [[all]]}, }, returns = { { name = "data", type = "string", description = [[The file contents.]], }, { name = "size", type = "number", description = [[How many bytes have been read.]], }, }, }, { prefix = "love.filesystem.", name = "write", description = [[Write data to a file. If you are getting the error message "Could not set write directory", try setting the save directory. This is done either with love.filesystem.setIdentity or by setting the identity field in love.conf.]], arguments = { { name = "name", type = "string", description = [[The name (and path) of the file.]], }, { name = "data", type = "string", description = [[The data that should be written to the file]], }, { name = "size", type = "number", description = [[How many bytes to write.]], default = [[all]]}, }, returns = { { name = "ok", type = "boolean", description = [[If the operation was successful]], }, }, }, { prefix = "love.filesystem.", name = "lines", description = [[Iterate over the lines in a file.]], arguments = { { name = "name", type = "string", description = [[The name (and path) of the file.]], }, }, returns = { { name = "iterator", type = "function", description = [[A function that iterates over all the lines in the file.]], }, }, }, { prefix = "love.filesystem.", name = "load", description = [[Load a file (but not run it).]], arguments = { { name = "name", type = "string", description = [[The name (and path) of the file.]], }, }, returns = { { name = "chunk", type = "function", description = [[The loaded chunk.]], }, }, }, { prefix = "love.filesystem.", name = "enumerate", description = [[Returns a table with the names of files and subdirectories in the directory in an undefined order.]], arguments = { { name = "dir", type = "string", description = [[The directory.]], }, }, returns = { { name = "items", type = "table", description = [[A sequence with the names of all files and subdirectories as strings.]], }, }, }, { prefix = "love.filesystem.", name = "mkdir", description = [[Creates a directory.]], arguments = { { name = "name", type = "string", description = [[The directory to create.]], }, }, returns = { { name = "ok", type = "boolean", description = [[True if the directory was created, false if not.]], }, }, }, { prefix = "love.filesystem.", name = "remove", description = [[Removes a file or empty directory.]], arguments = { { name = "name", type = "string", description = [[The file or empty directory to remove.]], }, }, returns = { { name = "ok", type = "boolean", description = [[True if the file/directory was removed, false otherwise.]], }, }, }, { prefix = "love.filesystem.", name = "getLastModified", description = [[Gets the last modification time of a file.]], arguments = { { name = "filename", type = "string", description = [[The path and name to a file.]], }, }, returns = { { name = "modtime", type = "number", description = [[The last modification time in seconds since the unix epoch or nil on failure.]], }, }, }, { prefix = "love.filesystem.", name = "setIdentity", description = [[Sets the write directory for your game. Note that you can only set the name of the folder to store your files in, not the location.]], arguments = { { name = "name", type = "string", description = [[The new identity that will be used as write directory.]], }, }, }, '### Existence', { prefix = "love.filesystem.", name = "exists", description = [[Check whether a file or directory exists.]], arguments = { { name = "filename", type = "string", description = [[The path to a potential file or directory.]], }, }, returns = { { name = "exists", type = "boolean", description = [[True if there is a file or directory with the specified name. False otherwise.]], }, }, }, { prefix = "love.filesystem.", name = "isDirectory", description = [[Check whether something is a directory.]], arguments = { { name = "path", type = "string", description = [[The path to a potential directory.]], }, }, returns = { { name = "isDir", type = "boolean", description = [[True if there is a directory with the specified name. False otherwise.]], }, }, }, { prefix = "love.filesystem.", name = "isFile", description = [[Check whether something is a file.]], arguments = { { name = "path", type = "string", description = [[The path to a potential file.]], }, }, returns = { { name = "isFile", type = "boolean", description = [[True if there is a file with the specified name. False otherwise.]], }, }, }, '### Directory paths', { prefix = "love.filesystem.", name = "getAppdataDirectory", description = [[Returns the application data directory (could be the same as getUserDirectory)]], returns = { { name = "path", type = "string", description = [[The path of the application data directory.]], }, }, }, { prefix = "love.filesystem.", name = "getSaveDirectory", description = [[Gets the full path to the designated save directory. This can be useful if you want to use the standard io library (or something else) to read or write in the save directory.]], returns = { { name = "path", type = "string", description = [[The absolute path to the save directory.]], }, }, }, { prefix = "love.filesystem.", name = "getUserDirectory", description = [[Returns the path of the user's directory.]], returns = { { name = "path", type = "string", description = [[The path of the user's directory.]], }, }, }, { prefix = "love.filesystem.", name = "getWorkingDirectory", description = [[Gets the current working directory.]], returns = { { name = "path", type = "string", description = [[The current working directory.]], }, }, }, '### FileData', { prefix = "love.filesystem.", name = "newFileData", description = [[Creates a new FileData object.]], arguments = { { name = "contents", type = "string", description = [[The contents of the file.]], }, { name = "name", type = "string", description = [[The name of the file.]], }, { name = "decoder", type = "string", description = [[The method to use when decoding the contents.]], default = [['file']], options = {"'file'", "'base64'"}}, }, returns = { { name = "FileData", type = "object", description = [[Your new FileData.]], }, }, }, '## File', { prefix = "love.filesystem.", name = "newFile", description = [[Creates a new File object. It needs to be opened before it can be accessed.]], arguments = { { name = "filename", type = "string", description = [[The filename of the file to read.]], }, }, returns = { { name = "File", type = "object", description = [[The new File object.]], }, }, }, { prefix = "File:", name = "open", description = [[Open the file for write, read or append. If you are getting the error message "Could not set write directory", try setting the save directory. This is done either with love.filesystem.setIdentity or by setting the identity field in love.conf.]], arguments = { { name = "mode", type = "string", description = [[The mode to open the file in.]], options = {"'r'", "'w'", "'a'"}}, }, returns = { { name = "ok", type = "boolean", description = [[True on success, false otherwise.]], }, }, }, { prefix = "File:", name = "close", description = [[Closes a file.]], returns = { { name = "ok", type = "boolean", description = [[Whether closing was successful.]], }, }, }, { prefix = "File:", name = "read", description = [[Read a number of bytes from a file.]], arguments = { { name = "bytes", type = "number", description = [[The number of bytes to read]], default = [[all]]}, }, returns = { { name = "data", type = "string", description = [[The contents of the read bytes.]], }, { name = "size", type = "number", description = [[How many bytes have been read.]], }, }, }, { prefix = "File:", name = "write", description = [[Write data to a file.]], arguments = { { name = "data", type = "string", description = [[The data to write.]], }, { name = "size", type = "number", description = [[How many bytes to write.]], default = [[all]]}, }, returns = { { name = "ok", type = "boolean", description = [[Whether the operation was successful.]], }, }, }, { prefix = "File:", name = "lines", description = [[Iterate over all the lines in a file]], returns = { { name = "iterator", type = "function", description = [[The iterator (can be used in for loops)]], }, }, }, { prefix = "File:", name = "seek", description = [[Seek to a position in a file.]], arguments = { { name = "position", type = "number", description = [[The position to seek to.]], }, }, returns = { { name = "ok", type = "boolean", description = [[Whether the operation was successful.]], }, }, }, { prefix = "File:", name = "eof", description = [[If the end-of-file has been reached]], returns = { { name = "eof", type = "boolean", description = [[Whether EOF has been reached.]], }, }, }, { prefix = "File:", name = "getSize", description = [[Returns the file size.]], returns = { { name = "size", type = "number", description = [[The file size]], }, }, }, '## Event', { prefix = "love.event.", name = "push", description = [[Adds an event to the event queue.]], arguments = { { name = "e", type = "Event", description = [[The name of the event.]], }, { name = "a", type = "mixed", description = [[First event argument.]], }, { name = "b", type = "mixed", description = [[Second event argument.]], }, { name = "c", type = "mixed", description = [[Third event argument.]], }, { name = "d", type = "mixed", description = [[Fourth event argument.]], }, }, }, { prefix = "love.event.", name = "quit", description = [[Adds the quit event to the queue. The quit event is a signal for the event handler to close LÖVE. It's possible to abort the exit process with the love.quit callback.]], }, { prefix = "love.event.", name = "poll", description = [[Returns an iterator for messages in the event queue.]], returns = { { name = "iterator", type = "function", description = [[Iterator function usable in a for loop.]], }, }, }, { prefix = "love.event.", name = "wait", description = [[Like love.event.poll but blocks until there is an event in the queue.]], returns = { { name = "e", type = "Event", description = [[The type of event.]], }, { name = "a", type = "mixed", description = [[First event argument.]], }, { name = "b", type = "mixed", description = [[Second event argument.]], }, { name = "c", type = "mixed", description = [[Third event argument.]], }, { name = "d", type = "mixed", description = [[Fourth event argument.]], }, }, }, { prefix = "love.event.", name = "pump", description = [[Pump events into the event queue. This is a low-level function, and is usually not called by the user, but by love.run. Note that this does need to be called for any OS to think you're still running, and if you want to handle OS-generated events at all (think callbacks). love.event.pump can only be called from the main thread, but afterwards, the rest of love.event can be used from any other thread.]], }, { prefix = "love.event.", name = "clear", description = [[Clears the event queue.]], }, '## Thread', { prefix = "love.thread.", name = "newThread", description = [[Creates a new Thread from a File or Data object.]], arguments = { { name = "name", type = "string", description = [[The name of the thread.]], }, { name = "path/File/FileData", type = "string", description = [[The file of the thread.]], }, }, returns = { { name = "Thread", type = "object", description = [[A new Thread that has yet to be started.]], }, }, }, { prefix = "love.thread.", name = "getThread", description = [[Look for a thread and get its object.]], arguments = { { name = "name", type = "string", description = [[The name of the thread to return.]], }, }, returns = { { name = "Thread", type = "object", description = [[The thread with that name.]], }, }, }, { prefix = "love.thread.", name = "getThreads", description = [[Get all threads.]], returns = { { name = "threads", type = "table", description = [[A table containing all threads indexed by their names.]], }, }, }, { prefix = "Thread:", name = "getKeys", description = [[Returns the names of all messages in a table.]], returns = { { name = "msgNames", type = "table", description = [[A sequence with all the message names.]], }, }, }, { prefix = "Thread:", name = "getName", description = [[Get the name of a thread.]], returns = { { name = "name", type = "string", description = [[The name of the thread.]], }, }, }, { prefix = "Thread:", name = "start", description = [[Starts the thread.]], }, { prefix = "Thread:", name = "wait", description = [[Wait for a thread to finish. This call will block until the thread finishes.]], }, '### Message box', { prefix = "Thread:", name = "set", description = [[Sets a value in the message box of the thread. The name of the message can be any string. The value of the message can be a boolean, string, number or a LÖVE userdata. Foreign userdata (Lua's files, LuaSocket, ...), functions or tables are not supported.]], arguments = { { name = "name", type = "string", description = [[The name of the message.]], }, { name = "value", type = "mixed", description = [[The contents of the message.]], }, }, }, { prefix = "Thread:", name = "get", description = [[Retrieves the value of a message and removes it from the thread's message box. The name of the message can be any string. The value of the message can be a boolean, string, number or a LÖVE userdata. It returns nil if there's no message with the given name.]], returns = { { name = "value", type = "string", description = [[The contents of the message or nil when no message in message box.]], }, }, arguments = { { name = "name", type = "string", description = [[The name of the message.]], }, }, }, { prefix = "Thread:", name = "peek", description = [[Retrieves the value of a message, but leaves it in the thread's message box. The name of the message can be any string. The value of the message can be a boolean, string, number or a LÖVE userdata. It returns nil, if there's no message with the given name. ]], arguments = { { name = "name", type = "string", description = [[The name of the message.]], }, }, returns = { { name = "value", type = "mixed", description = [[The contents of the message.]], }, }, }, { prefix = "Thread:", name = "demand", description = [[Receive a message from a thread. Wait for the message to exist before returning. Returns nil if there is an error in the thread.]], arguments = { { name = "name", type = "string", description = [[The name of the message.]], }, }, returns = { { name = "value", type = "mixed", description = [[The contents of the message.]], }, }, }, '## Timer', { prefix = "love.timer.", name = "getFPS", description = [[Returns the current frames per second. Displaying the FPS with love.graphics.print or love.graphics.setCaption can have an impact on this value. Keep this in mind while benchmarking your game.]], returns = { { name = "fps", type = "number", description = [[The current FPS.]], }, }, }, { prefix = "love.timer.", name = "sleep", description = [[Sleeps the program for the specified amount of time.]], arguments = { { name = "s", type = "number", description = [[Seconds to sleep for.]], }, }, }, { prefix = "love.timer.", name = "getDelta", description = [[Returns the time between the last two frames.]], returns = { { name = "dt", type = "number", description = [[The time passed (in seconds).]], }, }, }, { prefix = "love.timer.", name = "step", description = [[Measures the time between two frames. Calling this changes the return value of love.timer.getDelta.]], }, '### Timing', { prefix = "love.timer.", name = "getMicroTime", description = [[Returns the value of a timer with an unspecified starting time. The time is accurate to the microsecond.]], returns = { { name = "time", type = "number", description = [[The time passed (in seconds).]], }, }, }, { prefix = "love.timer.", name = "getTime", description = [[Returns the value of a timer with an unspecified starting time. This function should only be used to calculate differences between points in time, as the starting time of the timer is unknown.]], returns = { { name = "time", type = "number", description = [[The time in seconds.]], }, }, }, } s = '' --s = s .. '' s = s.. [[]] s = s .. '' for i, item in ipairs(data) do if type(item) == 'string' then local a, b = item:match('(#*) (.*)') if a == '###' then s = s .. '\n' elseif a == '##' or a == '#' then s = s .. '\n' end else s = s .. '' s = s .. '' .. '' s = s .. '' end end s = s .. '
' .. b .. '
■ ' .. b .. '
' if item.returns then for i, v in ipairs(item.returns) do local o = '' if v.options then o = '\n\nOptions:\n\n' for _, option in ipairs(v.options) do o = o .. option .. '\n' end end s = s.. '' .. '' .. v.name .. '' if i ~= #item.returns then s = s .. ', ' end end s = s .. ' = ' end s = s .. ''.. item.prefix .. '' .. ''.. '' .. '' .. item.name .. ''.. '' if item.arguments then s = s .. ' ( ' for i, v in ipairs(item.arguments) do local d = '' local o = '' if v.default then d = 'Default: '..v.default..'\n\n' v.name = v.name .. '°' end if v.options then o = '\n\nOptions:\n' for _, option in ipairs(v.options) do o = o .. option if _ ~= #v.options then o = o ..'\n' end end end s = s .. ''.. '' .. v.name .. '' if i ~= #item.arguments then s = s .. ', ' end end s = s .. ' )' else s = s .. ' ( ) ' end s = s .. '
' function string_to_file(s, f) file = io.open(f, 'w') file:write(s) file:close() end string_to_file(s, 'love_reference.html') --print(s)