diff options
Diffstat (limited to 'meta/3rd/love2d/library')
-rw-r--r-- | meta/3rd/love2d/library/love.audio.lua | 22 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.data.lua | 6 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.event.lua | 14 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.filesystem.lua | 16 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.font.lua | 12 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.graphics.lua | 270 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.image.lua | 10 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.joystick.lua | 2 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.math.lua | 46 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.mouse.lua | 4 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.physics.lua | 50 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.sound.lua | 2 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.system.lua | 2 | ||||
-rw-r--r-- | meta/3rd/love2d/library/love.window.lua | 16 |
14 files changed, 236 insertions, 236 deletions
diff --git a/meta/3rd/love2d/library/love.audio.lua b/meta/3rd/love2d/library/love.audio.lua index 3849b7fb..acd59384 100644 --- a/meta/3rd/love2d/library/love.audio.lua +++ b/meta/3rd/love2d/library/love.audio.lua @@ -110,7 +110,7 @@ function love.audio.isEffectsSupported() end ---@param samplerate number # Number of samples per second when playing. ---@param bitdepth number # Bits per sample (8 or 16). ---@param channels number # 1 for mono or 2 for stereo. ----@param buffercount number # The number of buffers that can be queued up at any given time with Source:queue. Cannot be greater than 64. A sensible default (~8) is chosen if no value is specified. +---@param buffercount? number # The number of buffers that can be queued up at any given time with Source:queue. Cannot be greater than 64. A sensible default (~8) is chosen if no value is specified. ---@return love.Source source # The new Source usable with Source:queue. function love.audio.newQueueableSource(samplerate, bitdepth, channels, buffercount) end @@ -269,9 +269,9 @@ function RecordingDevice:isRecording() end ---Begins recording audio using this device. --- ---@param samplecount number # The maximum number of samples to store in an internal ring buffer when recording. RecordingDevice:getData clears the internal buffer when called. ----@param samplerate number # The number of samples per second to store when recording. ----@param bitdepth number # The number of bits per sample. ----@param channels number # Whether to record in mono or stereo. Most microphones don't support more than 1 channel. +---@param samplerate? number # The number of samples per second to store when recording. +---@param bitdepth? number # The number of bits per sample. +---@param channels? number # Whether to record in mono or stereo. Most microphones don't support more than 1 channel. ---@return boolean success # True if the device successfully began recording using the specified parameters, false if not. function RecordingDevice:start(samplecount, samplerate, bitdepth, channels) end @@ -345,7 +345,7 @@ function Source:getDirection() end --- ---Gets the duration of the Source. For streaming Sources it may not always be sample-accurate, and may return -1 if the duration cannot be determined at all. --- ----@param unit love.TimeUnit # The time unit for the return value. +---@param unit? love.TimeUnit # The time unit for the return value. ---@return number duration # The duration of the Source, or -1 if it cannot be determined. function Source:getDuration(unit) end @@ -355,7 +355,7 @@ function Source:getDuration(unit) end ---This function returns nil if the effect was applied with no filter settings associated to it. --- ---@param name string # The name of the effect. ----@param filtersettings table # An optional empty table that will be filled with the filter settings. +---@param filtersettings? table # An optional empty table that will be filled with the filter settings. ---@return {volume: number, highgain: number, lowgain: number} filtersettings # The settings for the filter associated to this effect, or nil if the effect is not present in this Source or has no filter associated. The table has the following fields: function Source:getEffect(name, filtersettings) end @@ -460,7 +460,7 @@ function Source:queue(sounddata) end ---Sets the currently playing position of the Source. --- ---@param offset number # The position to seek to. ----@param unit love.TimeUnit # The unit of the position value. +---@param unit? love.TimeUnit # The unit of the position value. function Source:seek(offset, unit) end --- @@ -487,7 +487,7 @@ function Source:setAttenuationDistances(ref, max) end --- ---@param innerAngle number # The inner angle from the Source's direction, in radians. The Source will play at normal volume if the listener is inside the cone defined by this angle. ---@param outerAngle number # The outer angle from the Source's direction, in radians. The Source will play at a volume between the normal and outer volumes, if the listener is in between the cones defined by the inner and outer angles. ----@param outerVolume number # The Source's volume when the listener is outside both the inner and outer cone angles. +---@param outerVolume? number # The Source's volume when the listener is outside both the inner and outer cone angles. function Source:setCone(innerAngle, outerAngle, outerVolume) end --- @@ -505,7 +505,7 @@ function Source:setDirection(x, y, z) end --- ---@overload fun(name: string, filtersettings: table):boolean ---@param name string # The name of the effect previously set up with love.audio.setEffect. ----@param enable boolean # If false and the given effect name was previously enabled on this Source, disables the effect. +---@param enable? boolean # If false and the given effect name was previously enabled on this Source, disables the effect. ---@return boolean success # Whether the effect was successfully applied to this Source. function Source:setEffect(name, enable) end @@ -542,7 +542,7 @@ function Source:setPosition(x, y, z) end --- ---By default, all sources are absolute and therefore relative to the origin of love's coordinate system 0, 0. Only absolute sources are affected by the position of the listener. Please note that positional audio only works for mono (i.e. non-stereo) sources. --- ----@param enable boolean # True to make the position, velocity, direction and cone angles relative to the listener, false to make them absolute. +---@param enable? boolean # True to make the position, velocity, direction and cone angles relative to the listener, false to make them absolute. function Source:setRelative(enable) end --- @@ -584,7 +584,7 @@ function Source:stop() end --- ---Gets the currently playing position of the Source. --- ----@param unit love.TimeUnit # The type of unit for the return value. +---@param unit? love.TimeUnit # The type of unit for the return value. ---@return number position # The currently playing position of the Source. function Source:tell(unit) end diff --git a/meta/3rd/love2d/library/love.data.lua b/meta/3rd/love2d/library/love.data.lua index c2139c8d..53a51d4b 100644 --- a/meta/3rd/love2d/library/love.data.lua +++ b/meta/3rd/love2d/library/love.data.lua @@ -13,7 +13,7 @@ love.data = {} ---@param container love.ContainerType # What type to return the compressed data as. ---@param format love.CompressedDataFormat # The format to use when compressing the string. ---@param rawstring string # The raw (un-compressed) string to compress. ----@param level number # The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used. +---@param level? number # The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used. ---@return love.CompressedData|string compressedData # CompressedData/string which contains the compressed version of rawstring. function love.data.compress(container, format, rawstring, level) end @@ -44,7 +44,7 @@ function love.data.decompress(container, compressedData) end ---@param container love.ContainerType # What type to return the encoded data as. ---@param format love.EncodeFormat # The format of the output data. ---@param sourceString string # The raw data to encode. ----@param linelength number # The maximum line length of the output. Only supported for base64, ignored if 0. +---@param linelength? number # The maximum line length of the output. Only supported for base64, ignored if 0. ---@return love.ByteData|string encoded # ByteData/string which contains the encoded version of source. function love.data.encode(container, format, sourceString, linelength) end @@ -105,7 +105,7 @@ function love.data.pack(container, format, v1) end ---@overload fun(format: string, data: love.Data, pos: number):number|boolean|string, number|boolean|string, number ---@param format string # A string determining how the values were packed. Follows the rules of Lua 5.3's string.pack format strings. ---@param datastring string # A string containing the packed (serialized) data. ----@param pos number # Where to start reading in the string. Negative values can be used to read relative from the end of the string. +---@param pos? number # Where to start reading in the string. Negative values can be used to read relative from the end of the string. ---@return number|boolean|string v1 # The first value (number, boolean, or string) that was unpacked. ---@return number index # The index of the first unread byte in the data string. function love.data.unpack(format, datastring, pos) end diff --git a/meta/3rd/love2d/library/love.event.lua b/meta/3rd/love2d/library/love.event.lua index b6523b9e..3e8d7ff4 100644 --- a/meta/3rd/love2d/library/love.event.lua +++ b/meta/3rd/love2d/library/love.event.lua @@ -34,12 +34,12 @@ function love.event.pump() end ---From 0.10.0 onwards, you may pass an arbitrary amount of arguments with this function, though the default callbacks don't ever use more than six. --- ---@param n love.Event # The name of the event. ----@param a any # First event argument. ----@param b any # Second event argument. ----@param c any # Third event argument. ----@param d any # Fourth event argument. ----@param e any # Fifth event argument. ----@param f any # Sixth event argument. +---@param a? any # First event argument. +---@param b? any # Second event argument. +---@param c? any # Third event argument. +---@param d? any # Fourth event argument. +---@param e? any # Fifth event argument. +---@param f? any # Sixth event argument. function love.event.push(n, a, b, c, d, e, f) end --- @@ -48,7 +48,7 @@ function love.event.push(n, a, b, c, d, e, f) end ---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. --- ---@overload fun(restart: string|"'restart'") ----@param exitstatus number # The program exit status to use when closing the application. +---@param exitstatus? number # The program exit status to use when closing the application. function love.event.quit(exitstatus) end --- diff --git a/meta/3rd/love2d/library/love.filesystem.lua b/meta/3rd/love2d/library/love.filesystem.lua index 1d00c798..9f2d9ce8 100644 --- a/meta/3rd/love2d/library/love.filesystem.lua +++ b/meta/3rd/love2d/library/love.filesystem.lua @@ -12,7 +12,7 @@ love.filesystem = {} ---@overload fun(name: string, data: love.Data, size: number):boolean, string ---@param name string # The name (and path) of the file. ---@param data string # The string data to append to the file. ----@param size number # How many bytes to write. +---@param size? number # How many bytes to write. ---@return boolean success # True if the operation was successful, or nil if there was an error. ---@return string errormsg # The error message on failure. function love.filesystem.append(name, data, size) end @@ -72,7 +72,7 @@ function love.filesystem.getIdentity() end ---@overload fun(path: string, info: table):table ---@overload fun(path: string, filtertype: love.FileType, info: table):table ---@param path string # The file or directory path to check. ----@param filtertype love.FileType # If supplied, this parameter causes getInfo to only return the info table if the item at the given path matches the specified file type. +---@param filtertype? love.FileType # If supplied, this parameter causes getInfo to only return the info table if the item at the given path matches the specified file type. ---@return {type: love.FileType, size: number, modtime: number} info # A table containing information about the specified path, or nil if nothing exists at the path. The table contains the following fields: function love.filesystem.getInfo(path, filtertype) end @@ -171,7 +171,7 @@ function love.filesystem.load(name) end ---@overload fun(data: love.Data, archivename: string, mountpoint: string, appendToPath: boolean):boolean ---@param archive string # The folder or zip file in the game's save directory to mount. ---@param mountpoint string # The new path the archive will be mounted to. ----@param appendToPath boolean # Whether the archive will be searched when reading a filepath before or after already-mounted archives. This includes the game's source and save directories. +---@param appendToPath? boolean # Whether the archive will be searched when reading a filepath before or after already-mounted archives. This includes the game's source and save directories. ---@return boolean success # True if the archive was successfully mounted, false otherwise. function love.filesystem.mount(archive, mountpoint, appendToPath) end @@ -199,7 +199,7 @@ function love.filesystem.newFileData(contents, name) end --- ---@overload fun(container: love.ContainerType, name: string, size: number):love.FileData|string, number, nil, string ---@param name string # The name (and path) of the file. ----@param size number # How many bytes to read. +---@param size? number # How many bytes to read. ---@return string contents # The file contents. ---@return number size # How many bytes have been read. ---@return nil contents # returns nil as content. @@ -267,7 +267,7 @@ function love.filesystem.unmount(archive) end ---@overload fun(name: string, data: love.Data, size: number):boolean, string ---@param name string # The name (and path) of the file. ---@param data string # The string data to write to the file. ----@param size number # How many bytes to write. +---@param size? number # How many bytes to write. ---@return boolean success # If the operation was successful. ---@return string message # Error message if operation was unsuccessful. function love.filesystem.write(name, data, size) end @@ -354,7 +354,7 @@ function File:open(mode) end ---Read a number of bytes from a file. --- ---@overload fun(container: love.ContainerType, bytes: number):love.FileData|string, number ----@param bytes number # The number of bytes to read. +---@param bytes? number # The number of bytes to read. ---@return string contents # The contents of the read bytes. ---@return number size # How many bytes have been read. function File:read(bytes) end @@ -372,7 +372,7 @@ function File:seek(pos) end ---File:flush will force any buffered data to be written to the disk. --- ---@param mode love.BufferMode # The buffer mode to use. ----@param size number # The maximum size in bytes of the file's buffer. +---@param size? number # The maximum size in bytes of the file's buffer. ---@return boolean success # Whether the buffer mode was successfully set. ---@return string errorstr # The error string, if the buffer mode could not be set and an error occurred. function File:setBuffer(mode, size) end @@ -388,7 +388,7 @@ function File:tell() end --- ---@overload fun(data: love.Data, size: number):boolean, string ---@param data string # The string data to write. ----@param size number # How many bytes to write. +---@param size? number # How many bytes to write. ---@return boolean success # Whether the operation was successful. ---@return string err # The error string if an error occurred. function File:write(data, size) end diff --git a/meta/3rd/love2d/library/love.font.lua b/meta/3rd/love2d/library/love.font.lua index 807c01aa..27f49d0e 100644 --- a/meta/3rd/love2d/library/love.font.lua +++ b/meta/3rd/love2d/library/love.font.lua @@ -12,7 +12,7 @@ love.font = {} ---@overload fun(fileName: string, glyphs: string, dpiscale: number):love.Rasterizer ---@param imageData love.ImageData # The image data containing the drawable pictures of font glyphs. ---@param glyphs string # The sequence of glyphs in the ImageData. ----@param dpiscale number # DPI scale. +---@param dpiscale? number # DPI scale. ---@return love.Rasterizer rasterizer # The rasterizer. function love.font.newBMFontRasterizer(imageData, glyphs, dpiscale) end @@ -28,8 +28,8 @@ function love.font.newGlyphData(rasterizer, glyph) end --- ---@param imageData love.ImageData # Font image data. ---@param glyphs string # String containing font glyphs. ----@param extraSpacing number # Font extra spacing. ----@param dpiscale number # Font DPI scale. +---@param extraSpacing? number # Font extra spacing. +---@param dpiscale? number # Font DPI scale. ---@return love.Rasterizer rasterizer # The rasterizer. function love.font.newImageRasterizer(imageData, glyphs, extraSpacing, dpiscale) end @@ -51,9 +51,9 @@ function love.font.newRasterizer(filename) end --- ---@overload fun(fileName: string, size: number, hinting: love.HintingMode, dpiscale: number):love.Rasterizer ---@overload fun(fileData: love.FileData, size: number, hinting: love.HintingMode, dpiscale: number):love.Rasterizer ----@param size number # The font size. ----@param hinting love.HintingMode # True Type hinting mode. ----@param dpiscale number # The font DPI scale. +---@param size? number # The font size. +---@param hinting? love.HintingMode # True Type hinting mode. +---@param dpiscale? number # The font DPI scale. ---@return love.Rasterizer rasterizer # The rasterizer. function love.font.newTrueTypeRasterizer(size, hinting, dpiscale) end diff --git a/meta/3rd/love2d/library/love.graphics.lua b/meta/3rd/love2d/library/love.graphics.lua index ad4e1385..c6b5ead8 100644 --- a/meta/3rd/love2d/library/love.graphics.lua +++ b/meta/3rd/love2d/library/love.graphics.lua @@ -30,7 +30,7 @@ function love.graphics.applyTransform(transform) end ---@param radius number # Radius of the arc. ---@param angle1 number # The angle at which the arc begins. ---@param angle2 number # The angle at which the arc terminates. ----@param segments number # The number of segments used for drawing the arc. +---@param segments? number # The number of segments used for drawing the arc. function love.graphics.arc(drawmode, x, y, radius, angle1, angle2, segments) end --- @@ -77,8 +77,8 @@ function love.graphics.clear() end ---On some desktop systems this function may do nothing. --- ---@overload fun(discardcolors: table, discardstencil: boolean) ----@param discardcolor boolean # Whether to discard the texture(s) of the active Canvas(es) (the contents of the screen if no Canvas is active.) ----@param discardstencil boolean # Whether to discard the contents of the stencil buffer of the screen / active Canvas. +---@param discardcolor? boolean # Whether to discard the texture(s) of the active Canvas(es) (the contents of the screen if no Canvas is active.) +---@param discardstencil? boolean # Whether to discard the contents of the stencil buffer of the screen / active Canvas. function love.graphics.discard(discardcolor, discardstencil) end --- @@ -98,15 +98,15 @@ function love.graphics.discard(discardcolor, discardstencil) end ---@overload fun(drawable: love.Drawable, transform: love.Transform) ---@overload fun(texture: love.Texture, quad: love.Quad, transform: love.Transform) ---@param drawable love.Drawable # A drawable object. ----@param x number # The position to draw the object (x-axis). ----@param y number # The position to draw the object (y-axis). ----@param r number # Orientation (radians). ----@param sx number # Scale factor (x-axis). ----@param sy number # Scale factor (y-axis). ----@param ox number # Origin offset (x-axis). ----@param oy number # Origin offset (y-axis). ----@param kx number # Shearing factor (x-axis). ----@param ky number # Shearing factor (y-axis). +---@param x? number # The position to draw the object (x-axis). +---@param y? number # The position to draw the object (y-axis). +---@param r? number # Orientation (radians). +---@param sx? number # Scale factor (x-axis). +---@param sy? number # Scale factor (y-axis). +---@param ox? number # Origin offset (x-axis). +---@param oy? number # Origin offset (y-axis). +---@param kx? number # Shearing factor (x-axis). +---@param ky? number # Shearing factor (y-axis). function love.graphics.draw(drawable, x, y, r, sx, sy, ox, oy, kx, ky) end --- @@ -119,15 +119,15 @@ function love.graphics.draw(drawable, x, y, r, sx, sy, ox, oy, kx, ky) end ---@overload fun(mesh: love.Mesh, instancecount: number, transform: love.Transform) ---@param mesh love.Mesh # The mesh to render. ---@param instancecount number # The number of instances to render. ----@param x number # The position to draw the instances (x-axis). ----@param y number # The position to draw the instances (y-axis). ----@param r number # Orientation (radians). ----@param sx number # Scale factor (x-axis). ----@param sy number # Scale factor (y-axis). ----@param ox number # Origin offset (x-axis). ----@param oy number # Origin offset (y-axis). ----@param kx number # Shearing factor (x-axis). ----@param ky number # Shearing factor (y-axis). +---@param x? number # The position to draw the instances (x-axis). +---@param y? number # The position to draw the instances (y-axis). +---@param r? number # Orientation (radians). +---@param sx? number # Scale factor (x-axis). +---@param sy? number # Scale factor (y-axis). +---@param ox? number # Origin offset (x-axis). +---@param oy? number # Origin offset (y-axis). +---@param kx? number # Shearing factor (x-axis). +---@param ky? number # Shearing factor (y-axis). function love.graphics.drawInstanced(mesh, instancecount, x, y, r, sx, sy, ox, oy, kx, ky) end --- @@ -138,15 +138,15 @@ function love.graphics.drawInstanced(mesh, instancecount, x, y, r, sx, sy, ox, o ---@overload fun(texture: love.Texture, layerindex: number, quad: love.Quad, transform: love.Transform) ---@param texture love.Texture # The Array Texture to draw. ---@param layerindex number # The index of the layer to use when drawing. ----@param x number # The position to draw the texture (x-axis). ----@param y number # The position to draw the texture (y-axis). ----@param r number # Orientation (radians). ----@param sx number # Scale factor (x-axis). ----@param sy number # Scale factor (y-axis). ----@param ox number # Origin offset (x-axis). ----@param oy number # Origin offset (y-axis). ----@param kx number # Shearing factor (x-axis). ----@param ky number # Shearing factor (y-axis). +---@param x? number # The position to draw the texture (x-axis). +---@param y? number # The position to draw the texture (y-axis). +---@param r? number # Orientation (radians). +---@param sx? number # Scale factor (x-axis). +---@param sy? number # Scale factor (y-axis). +---@param ox? number # Origin offset (x-axis). +---@param oy? number # Origin offset (y-axis). +---@param kx? number # Shearing factor (x-axis). +---@param ky? number # Shearing factor (y-axis). function love.graphics.drawLayer(texture, layerindex, x, y, r, sx, sy, ox, oy, kx, ky) end --- @@ -482,7 +482,7 @@ function love.graphics.line(x1, y1, x2, y2) end ---To use an array image in a Shader, it must be declared as a ArrayImage or sampler2DArray type (instead of Image or sampler2D). The Texel(ArrayImage image, vec3 texturecoord) shader function must be used to get pixel colors from a slice of the array image. The vec3 argument contains the texture coordinate in the first two components, and the 0-based slice index in the third component. --- ---@param slices table # A table containing filepaths to images (or File, FileData, ImageData, or CompressedImageData objects), in an array. Each sub-image must have the same dimensions. A table of tables can also be given, where each sub-table contains all mipmap levels for the slice index of that sub-table. ----@param settings {mipmaps: boolean, linear: boolean, dpiscale: number} # Optional table of settings to configure the array image, containing the following fields: +---@param settings? {mipmaps: boolean, linear: boolean, dpiscale: number} # Optional table of settings to configure the array image, containing the following fields: ---@return love.Image image # An Array Image object. function love.graphics.newArrayImage(slices, settings) end @@ -542,7 +542,7 @@ function love.graphics.newCanvas() end --- ---@overload fun(faces: table, settings: table):love.Image ---@param filename string # The filepath to a cubemap image file (or a File, FileData, or ImageData). ----@param settings {mipmaps: boolean, linear: boolean} # Optional table of settings to configure the cubemap image, containing the following fields: +---@param settings? {mipmaps: boolean, linear: boolean} # Optional table of settings to configure the cubemap image, containing the following fields: ---@return love.Image image # An cubemap Image object. function love.graphics.newCubeImage(filename, settings) end @@ -593,8 +593,8 @@ function love.graphics.newImageFont(filename, glyphs) end ---@overload fun(vertexformat: table, vertexcount: number, mode: love.MeshDrawMode, usage: love.SpriteBatchUsage):love.Mesh ---@overload fun(vertexcount: number, texture: love.Texture, mode: love.MeshDrawMode):love.Mesh ---@param vertices {["1"]: number, ["2"]: number, ["3"]: number, ["4"]: number, ["5"]: number, ["6"]: number, ["7"]: number, ["8"]: number} # The table filled with vertex information tables for each vertex as follows: ----@param mode love.MeshDrawMode # How the vertices are used when drawing. The default mode 'fan' is sufficient for simple convex polygons. ----@param usage love.SpriteBatchUsage # The expected usage of the Mesh. The specified usage mode affects the Mesh's memory usage and performance. +---@param mode? love.MeshDrawMode # How the vertices are used when drawing. The default mode 'fan' is sufficient for simple convex polygons. +---@param usage? love.SpriteBatchUsage # The expected usage of the Mesh. The specified usage mode affects the Mesh's memory usage and performance. ---@return love.Mesh mesh # The new mesh. function love.graphics.newMesh(vertices, mode, usage) end @@ -603,7 +603,7 @@ function love.graphics.newMesh(vertices, mode, usage) end --- ---@overload fun(texture: love.Texture, buffer: number):love.ParticleSystem ---@param image love.Image # The image to use. ----@param buffer number # The max number of particles at the same time. +---@param buffer? number # The max number of particles at the same time. ---@return love.ParticleSystem system # A new ParticleSystem. function love.graphics.newParticleSystem(image, buffer) end @@ -637,7 +637,7 @@ function love.graphics.newShader(code) end ---@overload fun(image: love.Image, maxsprites: number, usage: love.SpriteBatchUsage):love.SpriteBatch ---@overload fun(texture: love.Texture, maxsprites: number, usage: love.SpriteBatchUsage):love.SpriteBatch ---@param image love.Image # The Image to use for the sprites. ----@param maxsprites number # The maximum number of sprites that the SpriteBatch can contain at any given time. Since version 11.0, additional sprites added past this number will automatically grow the spritebatch. +---@param maxsprites? number # The maximum number of sprites that the SpriteBatch can contain at any given time. Since version 11.0, additional sprites added past this number will automatically grow the spritebatch. ---@return love.SpriteBatch spriteBatch # The new SpriteBatch. function love.graphics.newSpriteBatch(image, maxsprites) end @@ -645,7 +645,7 @@ function love.graphics.newSpriteBatch(image, maxsprites) end ---Creates a new drawable Text object. --- ---@param font love.Font # The font to use for the text. ----@param textstring string # The initial string of text that the new Text object will contain. May be nil. +---@param textstring? string # The initial string of text that the new Text object will contain. May be nil. ---@return love.Text text # The new drawable Text object. function love.graphics.newText(font, textstring) end @@ -672,7 +672,7 @@ function love.graphics.newVideo(filename) end ---Array images are a much better choice than volume images for storing multiple different sprites in a single array image for directly drawing them. --- ---@param layers table # A table containing filepaths to images (or File, FileData, ImageData, or CompressedImageData objects), in an array. A table of tables can also be given, where each sub-table represents a single mipmap level and contains all layers for that mipmap. ----@param settings {mipmaps: boolean, linear: boolean} # Optional table of settings to configure the volume image, containing the following fields: +---@param settings? {mipmaps: boolean, linear: boolean} # Optional table of settings to configure the volume image, containing the following fields: ---@return love.Image image # A volume Image object. function love.graphics.newVolumeImage(layers, settings) end @@ -730,15 +730,15 @@ function love.graphics.present() end ---@overload fun(text: string, font: love.Font, transform: love.Transform) ---@overload fun(coloredtext: table, font: love.Font, transform: love.Transform) ---@param text string # The text to draw. ----@param x number # The position to draw the object (x-axis). ----@param y number # The position to draw the object (y-axis). ----@param r number # Orientation (radians). ----@param sx number # Scale factor (x-axis). ----@param sy number # Scale factor (y-axis). ----@param ox number # Origin offset (x-axis). ----@param oy number # Origin offset (y-axis). ----@param kx number # Shearing factor (x-axis). ----@param ky number # Shearing factor (y-axis). +---@param x? number # The position to draw the object (x-axis). +---@param y? number # The position to draw the object (y-axis). +---@param r? number # Orientation (radians). +---@param sx? number # Scale factor (x-axis). +---@param sy? number # Scale factor (y-axis). +---@param ox? number # Origin offset (x-axis). +---@param oy? number # Origin offset (y-axis). +---@param kx? number # Shearing factor (x-axis). +---@param ky? number # Shearing factor (y-axis). function love.graphics.print(text, x, y, r, sx, sy, ox, oy, kx, ky) end --- @@ -763,14 +763,14 @@ function love.graphics.print(text, x, y, r, sx, sy, ox, oy, kx, ky) end ---@param x number # The position on the x-axis. ---@param y number # The position on the y-axis. ---@param limit number # Wrap the line after this many horizontal pixels. ----@param align love.AlignMode # The alignment. ----@param r number # Orientation (radians). ----@param sx number # Scale factor (x-axis). ----@param sy number # Scale factor (y-axis). ----@param ox number # Origin offset (x-axis). ----@param oy number # Origin offset (y-axis). ----@param kx number # Shearing factor (x-axis). ----@param ky number # Shearing factor (y-axis). +---@param align? love.AlignMode # The alignment. +---@param r? number # Orientation (radians). +---@param sx? number # Scale factor (x-axis). +---@param sy? number # Scale factor (y-axis). +---@param ox? number # Origin offset (x-axis). +---@param oy? number # Origin offset (y-axis). +---@param kx? number # Shearing factor (x-axis). +---@param ky? number # Shearing factor (y-axis). function love.graphics.printf(text, x, y, limit, align, r, sx, sy, ox, oy, kx, ky) end --- @@ -825,7 +825,7 @@ function love.graphics.rotate(angle) end ---Scaling lasts until love.draw() exits. --- ---@param sx number # The scaling in the direction of the x-axis. ----@param sy number # The scaling in the direction of the y-axis. If omitted, it defaults to same as parameter sx. +---@param sy? number # The scaling in the direction of the y-axis. If omitted, it defaults to same as parameter sx. function love.graphics.scale(sx, sy) end --- @@ -836,7 +836,7 @@ function love.graphics.scale(sx, sy) end ---@param red number # The red component (0-1). ---@param green number # The green component (0-1). ---@param blue number # The blue component (0-1). ----@param alpha number # The alpha component (0-1). +---@param alpha? number # The alpha component (0-1). function love.graphics.setBackgroundColor(red, green, blue, alpha) end --- @@ -854,7 +854,7 @@ function love.graphics.setBlendMode(mode) end ---@overload fun(canvas: love.Canvas, slice: number, mipmap: number) ---@overload fun(setup: table) ---@param canvas love.Canvas # The new target. ----@param mipmap number # The mipmap level to render to, for Canvases with mipmaps. +---@param mipmap? number # The mipmap level to render to, for Canvases with mipmaps. function love.graphics.setCanvas(canvas, mipmap) end --- @@ -866,7 +866,7 @@ function love.graphics.setCanvas(canvas, mipmap) end ---@param red number # The amount of red. ---@param green number # The amount of green. ---@param blue number # The amount of blue. ----@param alpha number # The amount of alpha. The alpha value will be applied to all subsequent draw operations, even the drawing of an image. +---@param alpha? number # The amount of alpha. The alpha value will be applied to all subsequent draw operations, even the drawing of an image. function love.graphics.setColor(red, green, blue, alpha) end --- @@ -884,7 +884,7 @@ function love.graphics.setColorMask(red, green, blue, alpha) end --- ---@param min love.FilterMode # Filter mode used when scaling the image down. ---@param mag love.FilterMode # Filter mode used when scaling the image up. ----@param anisotropy number # Maximum amount of Anisotropic Filtering used. +---@param anisotropy? number # Maximum amount of Anisotropic Filtering used. function love.graphics.setDefaultFilter(min, mag, anisotropy) end --- @@ -948,7 +948,7 @@ function love.graphics.setMeshCullMode(mode) end ---@overload fun(file: love.File, size: number):love.Font ---@overload fun(data: love.Data, size: number):love.Font ---@overload fun(rasterizer: love.Rasterizer):love.Font ----@param size number # The size of the font. +---@param size? number # The size of the font. ---@return love.Font font # The new font. function love.graphics.setNewFont(size) end @@ -1010,9 +1010,9 @@ function love.graphics.shear(kx, ky) end ---Stencil values are integers within the range of 255. --- ---@param stencilfunction function # Function which draws geometry. The stencil values of pixels, rather than the color of each pixel, will be affected by the geometry. ----@param action love.StencilAction # How to modify any stencil values of pixels that are touched by what's drawn in the stencil function. ----@param value 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. ----@param keepvalues 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. +---@param action? love.StencilAction # How to modify any stencil values of pixels that are touched by what's drawn in the stencil function. +---@param value? 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. +---@param keepvalues? 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. function love.graphics.stencil(stencilfunction, action, value, keepvalues) end --- @@ -1217,7 +1217,7 @@ function Font:setFallbacks(fallbackfont1) end --- ---@param min love.FilterMode # How to scale a font down. ---@param mag love.FilterMode # How to scale a font up. ----@param anisotropy number # Maximum amount of anisotropic filtering used. +---@param anisotropy? number # Maximum amount of anisotropic filtering used. function Font:setFilter(min, mag, anisotropy) end --- @@ -1253,9 +1253,9 @@ function Image:isCompressed() end --- ---@param data love.ImageData # The new ImageData to replace the contents with. ---@param slice number # Which cubemap face, array index, or volume layer to replace, if applicable. ----@param mipmap number # The mimap level to replace, if the Image has mipmaps. ----@param x 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. ----@param y 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. +---@param mipmap? number # The mimap level to replace, if the Image has mipmaps. +---@param x? 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. +---@param y? 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. ---@param reloadmipmaps 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. function Image:replacePixels(data, slice, mipmap, x, y, reloadmipmaps) end @@ -1414,7 +1414,7 @@ function Mesh:setVertexMap(map) end ---@overload fun(data: love.Data, startvertex: number) ---@overload fun(vertices: table) ---@param vertices {attributecomponent: number} # 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, ...}. ----@param startvertex number # The index of the first vertex to replace. +---@param startvertex? number # The index of the first vertex to replace. function Mesh:setVertices(vertices, startvertex) end --- @@ -1697,8 +1697,8 @@ function ParticleSystem:setDirection(direction) end ---@param distribution love.AreaSpreadDistribution # The type of distribution for new particles. ---@param 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. ---@param 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. ----@param angle number # The angle in radians of the emission area. ----@param directionRelativeToCenter boolean # True if newly spawned particles will be oriented relative to the center of the emission area, false otherwise. +---@param angle? number # The angle in radians of the emission area. +---@param directionRelativeToCenter? boolean # True if newly spawned particles will be oriented relative to the center of the emission area, false otherwise. function ParticleSystem:setEmissionArea(distribution, dx, dy, angle, directionRelativeToCenter) end --- @@ -1726,15 +1726,15 @@ function ParticleSystem:setInsertMode(mode) end --- ---@param xmin number # The minimum acceleration along the x axis. ---@param ymin number # The minimum acceleration along the y axis. ----@param xmax number # The maximum acceleration along the x axis. ----@param ymax number # The maximum acceleration along the y axis. +---@param xmax? number # The maximum acceleration along the x axis. +---@param ymax? number # The maximum acceleration along the y axis. function ParticleSystem:setLinearAcceleration(xmin, ymin, xmax, ymax) end --- ---Sets the amount of linear damping (constant deceleration) for particles. --- ---@param min number # The minimum amount of linear damping applied to particles. ----@param max number # The maximum amount of linear damping applied to particles. +---@param max? number # The maximum amount of linear damping applied to particles. function ParticleSystem:setLinearDamping(min, max) end --- @@ -1750,7 +1750,7 @@ function ParticleSystem:setOffset(x, y) end ---Sets the lifetime of the particles. --- ---@param min number # The minimum life of the particles (in seconds). ----@param max number # The maximum life of the particles (in seconds). +---@param max? number # The maximum life of the particles (in seconds). function ParticleSystem:setParticleLifetime(min, max) end --- @@ -1772,7 +1772,7 @@ function ParticleSystem:setQuads(quad1, quad2) end ---Set the radial acceleration (away from the emitter). --- ---@param min number # The minimum acceleration. ----@param max number # The maximum acceleration. +---@param max? number # The maximum acceleration. function ParticleSystem:setRadialAcceleration(min, max) end --- @@ -1785,7 +1785,7 @@ function ParticleSystem:setRelativeRotation(enable) end ---Sets the rotation of the image upon particle creation (in radians). --- ---@param min number # The minimum initial angle (radians). ----@param max number # The maximum initial angle (radians). +---@param max? number # The maximum initial angle (radians). function ParticleSystem:setRotation(min, max) end --- @@ -1808,14 +1808,14 @@ function ParticleSystem:setSizes(size1, size2, size8) end ---Sets the speed of the particles. --- ---@param min number # The minimum linear speed of the particles. ----@param max number # The maximum linear speed of the particles. +---@param max? number # The maximum linear speed of the particles. function ParticleSystem:setSpeed(min, max) end --- ---Sets the spin of the sprite. --- ---@param min number # The minimum spin (radians per second). ----@param max number # The maximum spin (radians per second). +---@param max? number # The maximum spin (radians per second). function ParticleSystem:setSpin(min, max) end --- @@ -1834,7 +1834,7 @@ function ParticleSystem:setSpread(spread) end ---Sets the tangential acceleration (acceleration perpendicular to the particle's direction). --- ---@param min number # The minimum acceleration. ----@param max number # The maximum acceleration. +---@param max? number # The maximum acceleration. function ParticleSystem:setTangentialAcceleration(min, max) end --- @@ -1982,13 +1982,13 @@ local SpriteBatch = {} ---@overload fun(quad: love.Quad, x: number, y: number, r: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number):number ---@param x number # The position to draw the object (x-axis). ---@param y number # The position to draw the object (y-axis). ----@param r number # Orientation (radians). ----@param sx number # Scale factor (x-axis). ----@param sy number # Scale factor (y-axis). ----@param ox number # Origin offset (x-axis). ----@param oy number # Origin offset (y-axis). ----@param kx number # Shear factor (x-axis). ----@param ky number # Shear factor (y-axis). +---@param r? number # Orientation (radians). +---@param sx? number # Scale factor (x-axis). +---@param sy? number # Scale factor (y-axis). +---@param ox? number # Origin offset (x-axis). +---@param oy? number # Origin offset (y-axis). +---@param kx? number # Shear factor (x-axis). +---@param ky? number # Shear factor (y-axis). ---@return number id # An identifier for the added sprite. function SpriteBatch:add(x, y, r, sx, sy, ox, oy, kx, ky) end @@ -1999,15 +1999,15 @@ function SpriteBatch:add(x, y, r, sx, sy, ox, oy, kx, ky) end ---@overload fun(layerindex: number, transform: love.Transform):number ---@overload fun(layerindex: number, quad: love.Quad, transform: love.Transform):number ---@param layerindex number # The index of the layer to use for this sprite. ----@param x number # The position to draw the sprite (x-axis). ----@param y number # The position to draw the sprite (y-axis). ----@param r number # Orientation (radians). ----@param sx number # Scale factor (x-axis). ----@param sy number # Scale factor (y-axis). ----@param ox number # Origin offset (x-axis). ----@param oy number # Origin offset (y-axis). ----@param kx number # Shearing factor (x-axis). ----@param ky number # Shearing factor (y-axis). +---@param x? number # The position to draw the sprite (x-axis). +---@param y? number # The position to draw the sprite (y-axis). +---@param r? number # Orientation (radians). +---@param sx? number # Scale factor (x-axis). +---@param sy? number # Scale factor (y-axis). +---@param ox? number # Origin offset (x-axis). +---@param oy? number # Origin offset (y-axis). +---@param kx? number # Shearing factor (x-axis). +---@param ky? number # Shearing factor (y-axis). ---@return number spriteindex # The index of the added sprite, for use with SpriteBatch:set or SpriteBatch:setLayer. function SpriteBatch:addLayer(layerindex, x, y, r, sx, sy, ox, oy, kx, ky) end @@ -2072,13 +2072,13 @@ function SpriteBatch:getTexture() end ---@param spriteindex number # The index of the sprite that will be changed. ---@param x number # The position to draw the object (x-axis). ---@param y number # The position to draw the object (y-axis). ----@param r number # Orientation (radians). ----@param sx number # Scale factor (x-axis). ----@param sy number # Scale factor (y-axis). ----@param ox number # Origin offset (x-axis). ----@param oy number # Origin offset (y-axis). ----@param kx number # Shear factor (x-axis). ----@param ky number # Shear factor (y-axis). +---@param r? number # Orientation (radians). +---@param sx? number # Scale factor (x-axis). +---@param sy? number # Scale factor (y-axis). +---@param ox? number # Origin offset (x-axis). +---@param oy? number # Origin offset (y-axis). +---@param kx? number # Shear factor (x-axis). +---@param ky? number # Shear factor (y-axis). function SpriteBatch:set(spriteindex, x, y, r, sx, sy, ox, oy, kx, ky) end --- @@ -2092,7 +2092,7 @@ function SpriteBatch:set(spriteindex, x, y, r, sx, sy, ox, oy, kx, ky) end ---@param r number # The amount of red. ---@param g number # The amount of green. ---@param b number # The amount of blue. ----@param a number # The amount of alpha. +---@param a? number # The amount of alpha. function SpriteBatch:setColor(r, g, b, a) end --- @@ -2111,15 +2111,15 @@ function SpriteBatch:setDrawRange(start, count) end ---@overload fun(spriteindex: number, layerindex: number, quad: love.Quad, transform: love.Transform) ---@param spriteindex number # The index of the existing sprite to replace. ---@param layerindex number # The index of the layer in the Array Texture to use for this sprite. ----@param x number # The position to draw the sprite (x-axis). ----@param y number # The position to draw the sprite (y-axis). ----@param r number # Orientation (radians). ----@param sx number # Scale factor (x-axis). ----@param sy number # Scale factor (y-axis). ----@param ox number # Origin offset (x-axis). ----@param oy number # Origin offset (y-axis). ----@param kx number # Shearing factor (x-axis). ----@param ky number # Shearing factor (y-axis). +---@param x? number # The position to draw the sprite (x-axis). +---@param y? number # The position to draw the sprite (y-axis). +---@param r? number # Orientation (radians). +---@param sx? number # Scale factor (x-axis). +---@param sy? number # Scale factor (y-axis). +---@param ox? number # Origin offset (x-axis). +---@param oy? number # Origin offset (y-axis). +---@param kx? number # Shearing factor (x-axis). +---@param ky? number # Shearing factor (y-axis). function SpriteBatch:setLayer(spriteindex, layerindex, x, y, r, sx, sy, ox, oy, kx, ky) end --- @@ -2139,15 +2139,15 @@ local Text = {} --- ---@overload fun(coloredtext: table, x: number, y: number, angle: number, sx: number, sy: number, ox: number, oy: number, kx: number, ky: number):number ---@param textstring string # The text to add to the object. ----@param x number # The position of the new text on the x-axis. ----@param y number # The position of the new text on the y-axis. ----@param angle number # The orientation of the new text in radians. ----@param sx number # Scale factor on the x-axis. ----@param sy number # Scale factor on the y-axis. ----@param ox number # Origin offset on the x-axis. ----@param oy number # Origin offset on the y-axis. ----@param kx number # Shearing / skew factor on the x-axis. ----@param ky number # Shearing / skew factor on the y-axis. +---@param x? number # The position of the new text on the x-axis. +---@param y? number # The position of the new text on the y-axis. +---@param angle? number # The orientation of the new text in radians. +---@param sx? number # Scale factor on the x-axis. +---@param sy? number # Scale factor on the y-axis. +---@param ox? number # Origin offset on the x-axis. +---@param oy? number # Origin offset on the y-axis. +---@param kx? number # Shearing / skew factor on the x-axis. +---@param ky? number # Shearing / skew factor on the y-axis. ---@return number index # An index number that can be used with Text:getWidth or Text:getHeight. function Text:add(textstring, x, y, angle, sx, sy, ox, oy, kx, ky) end @@ -2162,13 +2162,13 @@ function Text:add(textstring, x, y, angle, sx, sy, ox, oy, kx, ky) end ---@param align love.AlignMode # The alignment of the text. ---@param x number # The position of the new text (x-axis). ---@param y number # The position of the new text (y-axis). ----@param angle number # Orientation (radians). ----@param sx number # Scale factor (x-axis). ----@param sy number # Scale factor (y-axis). ----@param ox number # Origin offset (x-axis). ----@param oy number # Origin offset (y-axis). ----@param kx number # Shearing / skew factor (x-axis). ----@param ky number # Shearing / skew factor (y-axis). +---@param angle? number # Orientation (radians). +---@param sx? number # Scale factor (x-axis). +---@param sy? number # Scale factor (y-axis). +---@param ox? number # Origin offset (x-axis). +---@param oy? number # Origin offset (y-axis). +---@param kx? number # Shearing / skew factor (x-axis). +---@param ky? number # Shearing / skew factor (y-axis). ---@return number index # An index number that can be used with Text:getWidth or Text:getHeight. function Text:addf(textstring, wraplimit, align, x, y, angle, sx, sy, ox, oy, kx, ky) end @@ -2375,7 +2375,7 @@ function Texture:setDepthSampleMode(compare) end --- ---@param min love.FilterMode # Filter mode to use when minifying the texture (rendering it at a smaller size on-screen than its size in pixels). ---@param mag love.FilterMode # Filter mode to use when magnifying the texture (rendering it at a larger size on-screen than its size in pixels). ----@param anisotropy number # Maximum amount of anisotropic filtering to use. +---@param anisotropy? number # Maximum amount of anisotropic filtering to use. function Texture:setFilter(min, mag, anisotropy) end --- @@ -2389,7 +2389,7 @@ function Texture:setFilter(min, mag, anisotropy) end --- ---@overload fun() ---@param filtermode love.FilterMode # The filter mode to use in between mipmap levels. 'nearest' will often give better performance. ----@param sharpness number # A positive sharpness value makes the texture use a more detailed mipmap level when drawing, at the expense of performance. A negative value does the reverse. +---@param sharpness? number # A positive sharpness value makes the texture use a more detailed mipmap level when drawing, at the expense of performance. A negative value does the reverse. function Texture:setMipmapFilter(filtermode, sharpness) end --- @@ -2400,8 +2400,8 @@ function Texture:setMipmapFilter(filtermode, sharpness) end ---Clamped textures appear only once (with the edges of the texture stretching to fill the extent of the Quad), whereas repeated ones repeat as many times as there is room in the Quad. --- ---@param horiz love.WrapMode # Horizontal wrapping mode of the texture. ----@param vert love.WrapMode # Vertical wrapping mode of the texture. ----@param depth love.WrapMode # Wrapping mode for the z-axis of a Volume texture. +---@param vert? love.WrapMode # Vertical wrapping mode of the texture. +---@param depth? love.WrapMode # Wrapping mode for the z-axis of a Volume texture. function Texture:setWrap(horiz, vert, depth) end --- @@ -2481,13 +2481,13 @@ function Video:seek(offset) end --- ---@param min love.FilterMode # The filter mode used when scaling the Video down. ---@param mag love.FilterMode # The filter mode used when scaling the Video up. ----@param anisotropy number # Maximum amount of anisotropic filtering used. +---@param anisotropy? number # Maximum amount of anisotropic filtering used. function Video:setFilter(min, mag, anisotropy) end --- ---Sets the audio Source used for playing back the video's audio. The audio Source also controls playback speed and synchronization. --- ----@param source love.Source # The audio Source used for audio playback, or nil to disable audio synchronization. +---@param source? love.Source # The audio Source used for audio playback, or nil to disable audio synchronization. function Video:setSource(source) end --- diff --git a/meta/3rd/love2d/library/love.image.lua b/meta/3rd/love2d/library/love.image.lua index 65badbc1..9dc9c6e7 100644 --- a/meta/3rd/love2d/library/love.image.lua +++ b/meta/3rd/love2d/library/love.image.lua @@ -92,7 +92,7 @@ local ImageData = {} ---@overload fun(outFile: string) ---@overload fun(outFile: string, format: love.ImageFormat) ---@param format love.ImageFormat # The format to encode the image as. ----@param filename string # The filename to write the file to. If nil, no file will be written but the FileData will still be returned. +---@param filename? string # The filename to write the file to. If nil, no file will be written but the FileData will still be returned. ---@return love.FileData filedata # The encoded image as a new FileData object. function ImageData:encode(format, filename) end @@ -152,10 +152,10 @@ function ImageData:getWidth() end ---In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1. --- ---@param pixelFunction function # Function to apply to every pixel. ----@param x number # The x-axis of the top-left corner of the area within the ImageData to apply the function to. ----@param y number # The y-axis of the top-left corner of the area within the ImageData to apply the function to. ----@param width number # The width of the area within the ImageData to apply the function to. ----@param height number # The height of the area within the ImageData to apply the function to. +---@param x? number # The x-axis of the top-left corner of the area within the ImageData to apply the function to. +---@param y? number # The y-axis of the top-left corner of the area within the ImageData to apply the function to. +---@param width? number # The width of the area within the ImageData to apply the function to. +---@param height? number # The height of the area within the ImageData to apply the function to. function ImageData:mapPixel(pixelFunction, x, y, width, height) end --- diff --git a/meta/3rd/love2d/library/love.joystick.lua b/meta/3rd/love2d/library/love.joystick.lua index dab3ea25..65cfdc6b 100644 --- a/meta/3rd/love2d/library/love.joystick.lua +++ b/meta/3rd/love2d/library/love.joystick.lua @@ -58,7 +58,7 @@ function love.joystick.saveGamepadMappings(filename) end ---@param button love.GamepadButton # The virtual gamepad button to bind. ---@param inputtype love.JoystickInputType # The type of input to bind the virtual gamepad button to. ---@param inputindex number # The index of the axis, button, or hat to bind the virtual gamepad button to. ----@param hatdir love.JoystickHat # The direction of the hat, if the virtual gamepad button will be bound to a hat. nil otherwise. +---@param hatdir? love.JoystickHat # The direction of the hat, if the virtual gamepad button will be bound to a hat. nil otherwise. ---@return boolean success # Whether the virtual gamepad button was successfully bound. function love.joystick.setGamepadMapping(guid, button, inputtype, inputindex, hatdir) end diff --git a/meta/3rd/love2d/library/love.math.lua b/meta/3rd/love2d/library/love.math.lua index 87d73bfb..5cd0c64f 100644 --- a/meta/3rd/love2d/library/love.math.lua +++ b/meta/3rd/love2d/library/love.math.lua @@ -12,7 +12,7 @@ love.math = {} ---@param rb number # Red color component in 0..255 range. ---@param gb number # Green color component in 0..255 range. ---@param bb number # Blue color component in 0..255 range. ----@param ab number # Alpha color component in 0..255 range. +---@param ab? number # Alpha color component in 0..255 range. ---@return number r # Red color component in 0..1 range. ---@return number g # Green color component in 0..1 range. ---@return number b # Blue color component in 0..1 range. @@ -25,7 +25,7 @@ function love.math.colorFromBytes(rb, gb, bb, ab) end ---@param r number # Red color component. ---@param g number # Green color component. ---@param b number # Blue color component. ----@param a number # Alpha color component. +---@param a? number # Alpha color component. ---@return number rb # Red color component in 0..255 range. ---@return number gb # Green color component in 0..255 range. ---@return number bb # Blue color component in 0..255 range. @@ -37,8 +37,8 @@ function love.math.colorToBytes(r, g, b, a) end --- ---@overload fun(data: love.Data, format: love.CompressedDataFormat, level: number):love.CompressedData ---@param rawstring string # The raw (un-compressed) string to compress. ----@param format love.CompressedDataFormat # The format to use when compressing the string. ----@param level number # The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used. +---@param format? love.CompressedDataFormat # The format to use when compressing the string. +---@param level? number # The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used. ---@return love.CompressedData compressedData # A new Data object containing the compressed version of the string. function love.math.compress(rawstring, format, level) end @@ -164,8 +164,8 @@ function love.math.random() end --- ---Get a normally distributed pseudo random number. --- ----@param stddev number # Standard deviation of the distribution. ----@param mean number # The mean of the distribution. +---@param stddev? number # Standard deviation of the distribution. +---@param mean? number # The mean of the distribution. ---@return number number # Normally distributed random number with variance (stddev)² and the specified mean. function love.math.randomNormal(stddev, mean) end @@ -251,7 +251,7 @@ function BezierCurve:getSegment(startpoint, endpoint) end --- ---@param x number # Position of the control point along the x axis. ---@param y number # Position of the control point along the y axis. ----@param i number # Index of the control point. +---@param i? number # Index of the control point. function BezierCurve:insertControlPoint(x, y, i) end --- @@ -267,7 +267,7 @@ function BezierCurve:removeControlPoint(index) end --- ---If you are just interested to know the position on the curve given a parameter, use BezierCurve:evaluate. --- ----@param depth number # Number of recursive subdivision steps. +---@param depth? number # Number of recursive subdivision steps. ---@return table coordinates # List of x,y-coordinate pairs of points on the curve. function BezierCurve:render(depth) end @@ -280,7 +280,7 @@ function BezierCurve:render(depth) end --- ---@param startpoint number # The starting point along the curve. Must be between 0 and 1. ---@param endpoint number # The end of the segment to render. Must be between 0 and 1. ----@param depth number # Number of recursive subdivision steps. +---@param depth? number # Number of recursive subdivision steps. ---@return table coordinates # List of x,y-coordinate pairs of points on the specified part of the curve. function BezierCurve:renderSegment(startpoint, endpoint, depth) end @@ -288,16 +288,16 @@ function BezierCurve:renderSegment(startpoint, endpoint, depth) end ---Rotate the Bézier curve by an angle. --- ---@param angle number # Rotation angle in radians. ----@param ox number # X coordinate of the rotation center. ----@param oy number # Y coordinate of the rotation center. +---@param ox? number # X coordinate of the rotation center. +---@param oy? number # Y coordinate of the rotation center. function BezierCurve:rotate(angle, ox, oy) end --- ---Scale the Bézier curve by a factor. --- ---@param s number # Scale factor. ----@param ox number # X coordinate of the scaling center. ----@param oy number # Y coordinate of the scaling center. +---@param ox? number # X coordinate of the scaling center. +---@param oy? number # Y coordinate of the scaling center. function BezierCurve:scale(s, ox, oy) end --- @@ -349,8 +349,8 @@ function RandomGenerator:random() end --- ---Get a normally distributed pseudo random number. --- ----@param stddev number # Standard deviation of the distribution. ----@param mean number # The mean of the distribution. +---@param stddev? number # Standard deviation of the distribution. +---@param mean? number # The mean of the distribution. ---@return number number # Normally distributed random number with variance (stddev)² and the specified mean. function RandomGenerator:randomNormal(stddev, mean) end @@ -442,7 +442,7 @@ function Transform:rotate(angle) end ---Scales the Transform's coordinate system. This method does not reset any previously applied transformations. --- ---@param sx number # The relative scale factor along the x-axis. ----@param sy number # The relative scale factor along the y-axis. +---@param sy? number # The relative scale factor along the y-axis. ---@return love.Transform transform # The Transform object the method was called on. Allows easily chaining Transform methods. function Transform:scale(sx, sy) end @@ -463,13 +463,13 @@ function Transform:setMatrix(e1_1, e1_2, e4_4) end --- ---@param x number # The position of the Transform on the x-axis. ---@param y number # The position of the Transform on the y-axis. ----@param angle number # The orientation of the Transform in radians. ----@param sx number # Scale factor on the x-axis. ----@param sy number # Scale factor on the y-axis. ----@param ox number # Origin offset on the x-axis. ----@param oy number # Origin offset on the y-axis. ----@param kx number # Shearing / skew factor on the x-axis. ----@param ky number # Shearing / skew factor on the y-axis. +---@param angle? number # The orientation of the Transform in radians. +---@param sx? number # Scale factor on the x-axis. +---@param sy? number # Scale factor on the y-axis. +---@param ox? number # Origin offset on the x-axis. +---@param oy? number # Origin offset on the y-axis. +---@param kx? number # Shearing / skew factor on the x-axis. +---@param ky? number # Shearing / skew factor on the y-axis. ---@return love.Transform transform # The Transform object the method was called on. Allows easily chaining Transform methods. function Transform:setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky) end diff --git a/meta/3rd/love2d/library/love.mouse.lua b/meta/3rd/love2d/library/love.mouse.lua index af2eeae5..3e9de39c 100644 --- a/meta/3rd/love2d/library/love.mouse.lua +++ b/meta/3rd/love2d/library/love.mouse.lua @@ -89,8 +89,8 @@ function love.mouse.isVisible() end ---@overload fun(filename: string, hotx: number, hoty: number):love.Cursor ---@overload fun(fileData: love.FileData, hotx: number, hoty: number):love.Cursor ---@param imageData love.ImageData # The ImageData to use for the new Cursor. ----@param hotx number # The x-coordinate in the ImageData of the cursor's hot spot. ----@param hoty number # The y-coordinate in the ImageData of the cursor's hot spot. +---@param hotx? number # The x-coordinate in the ImageData of the cursor's hot spot. +---@param hoty? number # The y-coordinate in the ImageData of the cursor's hot spot. ---@return love.Cursor cursor # The new Cursor object. function love.mouse.newCursor(imageData, hotx, hoty) end diff --git a/meta/3rd/love2d/library/love.physics.lua b/meta/3rd/love2d/library/love.physics.lua index df2d9e39..7d3cd04d 100644 --- a/meta/3rd/love2d/library/love.physics.lua +++ b/meta/3rd/love2d/library/love.physics.lua @@ -42,9 +42,9 @@ function love.physics.getMeter() end ---The mass of the body gets calculated when a Fixture is attached or removed, but can be changed at any time with Body:setMass or Body:resetMassData. --- ---@param world love.World # The world to create the body in. ----@param x number # The x position of the body. ----@param y number # The y position of the body. ----@param type love.BodyType # The type of the body. +---@param x? number # The x position of the body. +---@param y? number # The y position of the body. +---@param type? love.BodyType # The type of the body. ---@return love.Body body # A new body. function love.physics.newBody(world, x, y, type) end @@ -79,7 +79,7 @@ function love.physics.newCircleShape(radius) end ---@param y1 number # The y position of the first anchor point (world space). ---@param x2 number # The x position of the second anchor point (world space). ---@param y2 number # The y position of the second anchor point (world space). ----@param collideConnected boolean # Specifies whether the two bodies should collide with each other. +---@param collideConnected? boolean # Specifies whether the two bodies should collide with each other. ---@return love.DistanceJoint joint # The new distance joint. function love.physics.newDistanceJoint(body1, body2, x1, y1, x2, y2, collideConnected) end @@ -100,7 +100,7 @@ function love.physics.newEdgeShape(x1, y1, x2, y2) end --- ---@param body love.Body # The body which gets the fixture attached. ---@param shape love.Shape # The shape to be copied to the fixture. ----@param density number # The density of the fixture. +---@param density? number # The density of the fixture. ---@return love.Fixture fixture # The new fixture. function love.physics.newFixture(body, shape, density) end @@ -112,7 +112,7 @@ function love.physics.newFixture(body, shape, density) end ---@param body2 love.Body # The second body to attach to the joint. ---@param x number # The x position of the anchor point. ---@param y number # The y position of the anchor point. ----@param collideConnected boolean # Specifies whether the two bodies should collide with each other. +---@param collideConnected? boolean # Specifies whether the two bodies should collide with each other. ---@return love.FrictionJoint joint # The new FrictionJoint. function love.physics.newFrictionJoint(body1, body2, x, y, collideConnected) end @@ -125,8 +125,8 @@ function love.physics.newFrictionJoint(body1, body2, x, y, collideConnected) end --- ---@param joint1 love.Joint # The first joint to connect with a gear joint. ---@param joint2 love.Joint # The second joint to connect with a gear joint. ----@param ratio number # The gear ratio. ----@param collideConnected boolean # Specifies whether the two bodies should collide with each other. +---@param ratio? number # The gear ratio. +---@param collideConnected? boolean # Specifies whether the two bodies should collide with each other. ---@return love.GearJoint joint # The new gear joint. function love.physics.newGearJoint(joint1, joint2, ratio, collideConnected) end @@ -138,7 +138,7 @@ function love.physics.newGearJoint(joint1, joint2, ratio, collideConnected) end ---@overload fun(body1: love.Body, body2: love.Body, correctionFactor: number, collideConnected: boolean):love.MotorJoint ---@param body1 love.Body # The first body to attach to the joint. ---@param body2 love.Body # The second body to attach to the joint. ----@param correctionFactor number # The joint's initial position correction factor, in the range of 1. +---@param correctionFactor? number # The joint's initial position correction factor, in the range of 1. ---@return love.MotorJoint joint # The new MotorJoint. function love.physics.newMotorJoint(body1, body2, correctionFactor) end @@ -183,7 +183,7 @@ function love.physics.newPolygonShape(x1, y1, x2, y2, x3, y3) end ---@param y number # The y coordinate of the anchor point. ---@param ax number # The x coordinate of the axis vector. ---@param ay number # The y coordinate of the axis vector. ----@param collideConnected boolean # Specifies whether the two bodies should collide with each other. +---@param collideConnected? boolean # Specifies whether the two bodies should collide with each other. ---@return love.PrismaticJoint joint # The new prismatic joint. function love.physics.newPrismaticJoint(body1, body2, x, y, ax, ay, collideConnected) end @@ -204,8 +204,8 @@ function love.physics.newPrismaticJoint(body1, body2, x, y, ax, ay, collideConne ---@param y1 number # The y coordinate of the pulley joint anchor in the first body. ---@param x2 number # The x coordinate of the pulley joint anchor in the second body. ---@param y2 number # The y coordinate of the pulley joint anchor in the second body. ----@param ratio number # The joint ratio. ----@param collideConnected boolean # Specifies whether the two bodies should collide with each other. +---@param ratio? number # The joint ratio. +---@param collideConnected? boolean # Specifies whether the two bodies should collide with each other. ---@return love.PulleyJoint joint # The new pulley joint. function love.physics.newPulleyJoint(body1, body2, gx1, gy1, gx2, gy2, x1, y1, x2, y2, ratio, collideConnected) end @@ -230,7 +230,7 @@ function love.physics.newRectangleShape(width, height) end ---@param body2 love.Body # The second body. ---@param x number # The x position of the connecting point. ---@param y number # The y position of the connecting point. ----@param collideConnected boolean # Specifies whether the two bodies should collide with each other. +---@param collideConnected? boolean # Specifies whether the two bodies should collide with each other. ---@return love.RevoluteJoint joint # The new revolute joint. function love.physics.newRevoluteJoint(body1, body2, x, y, collideConnected) end @@ -244,7 +244,7 @@ function love.physics.newRevoluteJoint(body1, body2, x, y, collideConnected) end ---@param x2 number # The x position of the second anchor point. ---@param y2 number # The y position of the second anchor point. ---@param maxLength number # The maximum distance for the bodies. ----@param collideConnected boolean # Specifies whether the two bodies should collide with each other. +---@param collideConnected? boolean # Specifies whether the two bodies should collide with each other. ---@return love.RopeJoint joint # The new RopeJoint. function love.physics.newRopeJoint(body1, body2, x1, y1, x2, y2, maxLength, collideConnected) end @@ -257,7 +257,7 @@ function love.physics.newRopeJoint(body1, body2, x1, y1, x2, y2, maxLength, coll ---@param body2 love.Body # The second body to attach to the joint. ---@param x number # The x position of the anchor point (world space). ---@param y number # The y position of the anchor point (world space). ----@param collideConnected boolean # Specifies whether the two bodies should collide with each other. +---@param collideConnected? boolean # Specifies whether the two bodies should collide with each other. ---@return love.WeldJoint joint # The new WeldJoint. function love.physics.newWeldJoint(body1, body2, x, y, collideConnected) end @@ -271,16 +271,16 @@ function love.physics.newWeldJoint(body1, body2, x, y, collideConnected) end ---@param y number # The y position of the anchor point. ---@param ax number # The x position of the axis unit vector. ---@param ay number # The y position of the axis unit vector. ----@param collideConnected boolean # Specifies whether the two bodies should collide with each other. +---@param collideConnected? boolean # Specifies whether the two bodies should collide with each other. ---@return love.WheelJoint joint # The new WheelJoint. function love.physics.newWheelJoint(body1, body2, x, y, ax, ay, collideConnected) end --- ---Creates a new World. --- ----@param xg number # The x component of gravity. ----@param yg number # The y component of gravity. ----@param sleep boolean # Whether the bodies in this world are allowed to sleep. +---@param xg? number # The x component of gravity. +---@param yg? number # The y component of gravity. +---@param sleep? boolean # Whether the bodies in this world are allowed to sleep. ---@return love.World world # A brave new World. function love.physics.newWorld(xg, yg, sleep) end @@ -1142,7 +1142,7 @@ function Fixture:getBody() end --- ---Returns the points of the fixture bounding box. In case the fixture has multiple children a 1-based index can be specified. For example, a fixture will have multiple children with a chain shape. --- ----@param index number # A bounding box of the fixture. +---@param index? number # A bounding box of the fixture. ---@return number topLeftX # The x position of the top-left point. ---@return number topLeftY # The y position of the top-left point. ---@return number bottomRightX # The x position of the bottom-right point. @@ -1248,7 +1248,7 @@ function Fixture:isSensor() end ---@param x2 number # The x position of the input line end point. ---@param y2 number # The y position of the input line end point. ---@param maxFraction number # Ray length parameter. ----@param childIndex number # The index of the child the ray gets cast against. +---@param childIndex? number # The index of the child the ray gets cast against. ---@return number xn # The x component of the normal vector of the edge where the ray hit the shape. ---@return number yn # The y component of the normal vector of the edge where the ray hit the shape. ---@return number fraction # The position on the input line where the intersection happened as a factor of the line length. @@ -1917,7 +1917,7 @@ local Shape = {} ---@param tx number # The translation of the shape on the x-axis. ---@param ty number # The translation of the shape on the y-axis. ---@param tr number # The shape rotation. ----@param childIndex number # The index of the child to compute the bounding box of. +---@param childIndex? number # The index of the child to compute the bounding box of. ---@return number topLeftX # The x position of the top-left point. ---@return number topLeftY # The y position of the top-left point. ---@return number bottomRightX # The x position of the bottom-right point. @@ -1973,7 +1973,7 @@ function Shape:getType() end ---@param tx number # The translation of the shape on the x-axis. ---@param ty number # The translation of the shape on the y-axis. ---@param tr number # The shape rotation. ----@param childIndex number # The index of the child the ray gets cast against. +---@param childIndex? number # The index of the child the ray gets cast against. ---@return number xn # The x component of the normal vector of the edge where the ray hit the shape. ---@return number yn # The y component of the normal vector of the edge where the ray hit the shape. ---@return number fraction # The position on the input line where the intersection happened as a factor of the line length. @@ -2266,8 +2266,8 @@ function World:translateOrigin(x, y) end ---Update the state of the world. --- ---@param dt number # The time (in seconds) to advance the physics simulation. ----@param velocityiterations number # The maximum number of steps used to determine the new velocities when resolving a collision. ----@param positioniterations number # The maximum number of steps used to determine the new positions when resolving a collision. +---@param velocityiterations? number # The maximum number of steps used to determine the new velocities when resolving a collision. +---@param positioniterations? number # The maximum number of steps used to determine the new positions when resolving a collision. function World:update(dt, velocityiterations, positioniterations) end --- diff --git a/meta/3rd/love2d/library/love.sound.lua b/meta/3rd/love2d/library/love.sound.lua index 32b0a35c..2dd18b6d 100644 --- a/meta/3rd/love2d/library/love.sound.lua +++ b/meta/3rd/love2d/library/love.sound.lua @@ -11,7 +11,7 @@ love.sound = {} --- ---@overload fun(filename: string, buffer: number):love.Decoder ---@param file love.File # The file with encoded sound data. ----@param buffer number # The size of each decoded chunk, in bytes. +---@param buffer? number # The size of each decoded chunk, in bytes. ---@return love.Decoder decoder # A new Decoder object. function love.sound.newDecoder(file, buffer) end diff --git a/meta/3rd/love2d/library/love.system.lua b/meta/3rd/love2d/library/love.system.lua index a3c41df3..2419688a 100644 --- a/meta/3rd/love2d/library/love.system.lua +++ b/meta/3rd/love2d/library/love.system.lua @@ -56,7 +56,7 @@ function love.system.setClipboardText(text) end --- ---Causes the device to vibrate, if possible. Currently this will only work on Android and iOS devices that have a built-in vibration motor. --- ----@param seconds number # The duration to vibrate for. If called on an iOS device, it will always vibrate for 0.5 seconds due to limitations in the iOS system APIs. +---@param seconds? number # The duration to vibrate for. If called on an iOS device, it will always vibrate for 0.5 seconds due to limitations in the iOS system APIs. function love.system.vibrate(seconds) end --- diff --git a/meta/3rd/love2d/library/love.window.lua b/meta/3rd/love2d/library/love.window.lua index 798fc3d5..359ffdbe 100644 --- a/meta/3rd/love2d/library/love.window.lua +++ b/meta/3rd/love2d/library/love.window.lua @@ -40,7 +40,7 @@ function love.window.getDPIScale() end --- ---Gets the width and height of the desktop. --- ----@param displayindex number # The index of the display, if multiple monitors are available. +---@param displayindex? number # The index of the display, if multiple monitors are available. ---@return string width # The width of the desktop. ---@return string height # The height of the desktop. function love.window.getDesktopDimensions(displayindex) end @@ -54,14 +54,14 @@ function love.window.getDisplayCount() end --- ---Gets the name of a display. --- ----@param displayindex number # The index of the display to get the name of. +---@param displayindex? number # The index of the display to get the name of. ---@return string name # The name of the specified display. function love.window.getDisplayName(displayindex) end --- ---Gets current device display orientation. --- ----@param displayindex number # Display index to get its display orientation, or nil for default display index. +---@param displayindex? number # Display index to get its display orientation, or nil for default display index. ---@return love.DisplayOrientation orientation # Current device display orientation. function love.window.getDisplayOrientation(displayindex) end @@ -75,7 +75,7 @@ function love.window.getFullscreen() end --- ---Gets a list of supported fullscreen modes. --- ----@param displayindex number # The index of the display, if multiple monitors are available. +---@param displayindex? number # The index of the display, if multiple monitors are available. ---@return table modes # A table of width/height pairs. (Note that this may not be in order.) function love.window.getFullscreenModes(displayindex) end @@ -189,7 +189,7 @@ function love.window.minimize() end --- ---In Windows the taskbar icon will flash, and in OS X the dock icon will bounce. --- ----@param continuous boolean # Whether to continuously request attention until the window becomes active, or to do it only once. +---@param continuous? boolean # Whether to continuously request attention until the window becomes active, or to do it only once. function love.window.requestAttention(continuous) end --- @@ -240,7 +240,7 @@ function love.window.setMode(width, height, flags) end --- ---@param x number # The x-coordinate of the window's position. ---@param y number # The y-coordinate of the window's position. ----@param displayindex number # The index of the display that the new window position is relative to. +---@param displayindex? number # The index of the display that the new window position is relative to. function love.window.setPosition(x, y, displayindex) end --- @@ -261,8 +261,8 @@ function love.window.setVSync(vsync) end ---@overload fun(title: string, message: string, buttonlist: table, type: love.MessageBoxType, attachtowindow: boolean):number ---@param title string # The title of the message box. ---@param message string # The text inside the message box. ----@param type love.MessageBoxType # The type of the message box. ----@param attachtowindow boolean # Whether the message box should be attached to the love window or free-floating. +---@param type? love.MessageBoxType # The type of the message box. +---@param attachtowindow? boolean # Whether the message box should be attached to the love window or free-floating. ---@return boolean success # Whether the message box was successfully displayed. function love.window.showMessageBox(title, message, type, attachtowindow) end |