diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-20 19:19:39 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-20 19:19:39 +0800 |
commit | 8e3de6b5653ea7087a248b3eb2a4aea6067688b5 (patch) | |
tree | e99d12883c1fced1a3fb67f2039ac0475dacb79d | |
parent | 9de98dc808dc01fbef9e4abfe60d2d76f7691c13 (diff) | |
download | lua-language-server-8e3de6b5653ea7087a248b3eb2a4aea6067688b5.zip |
update
21 files changed, 3487 insertions, 771 deletions
diff --git a/meta/3rd/love2d/library/love.audio.lua b/meta/3rd/love2d/library/love.audio.lua index bff10a8e..c7d1b717 100644 --- a/meta/3rd/love2d/library/love.audio.lua +++ b/meta/3rd/love2d/library/love.audio.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.audio love.audio = {} @@ -188,6 +189,9 @@ function love.audio.setVolume(volume) end --- function love.audio.stop() end +--- +---Represents an audio input device capable of recording sounds. +--- ---@class love.RecordingDevice: love.Object local RecordingDevice = {} @@ -251,6 +255,13 @@ function RecordingDevice:start(samplecount, samplerate, bitdepth, channels) end ---@return love.SoundData data # The sound data currently in the device's buffer, or nil if the device wasn't recording. function RecordingDevice:stop() end +--- +---A Source represents audio you can play back. +--- +---You can do interesting things with Sources, like set the volume, pitch, and its position relative to the listener. Please note that positional audio only works for mono (i.e. non-stereo) sources. +--- +---The Source controls (play/pause/stop) act according to the following state table. +--- ---@class love.Source: love.Object local Source = {} @@ -531,41 +542,144 @@ function Source:stop() end ---@return number position # The currently playing position of the Source. function Source:tell(unit) end +--- +---The different distance models. +--- +---Extended information can be found in the chapter "3.4. Attenuation By Distance" of the OpenAL 1.1 specification. +--- ---@class love.DistanceModel ----@field none integer # Sources do not get attenuated. ----@field inverse integer # Inverse distance attenuation. ----@field inverseclamped integer # Inverse distance attenuation. Gain is clamped. In version 0.9.2 and older this is named '''inverse clamped'''. ----@field linear integer # Linear attenuation. ----@field linearclamped integer # Linear attenuation. Gain is clamped. In version 0.9.2 and older this is named '''linear clamped'''. ----@field exponent integer # Exponential attenuation. ----@field exponentclamped integer # Exponential attenuation. Gain is clamped. In version 0.9.2 and older this is named '''exponent clamped'''. +--- +---Sources do not get attenuated. +--- +---@field none integer +--- +---Inverse distance attenuation. +--- +---@field inverse integer +--- +---Inverse distance attenuation. Gain is clamped. In version 0.9.2 and older this is named '''inverse clamped'''. +--- +---@field inverseclamped integer +--- +---Linear attenuation. +--- +---@field linear integer +--- +---Linear attenuation. Gain is clamped. In version 0.9.2 and older this is named '''linear clamped'''. +--- +---@field linearclamped integer +--- +---Exponential attenuation. +--- +---@field exponent integer +--- +---Exponential attenuation. Gain is clamped. In version 0.9.2 and older this is named '''exponent clamped'''. +--- +---@field exponentclamped integer +--- +---The different types of effects supported by love.audio.setEffect. +--- ---@class love.EffectType ----@field chorus integer # Plays multiple copies of the sound with slight pitch and time variation. Used to make sounds sound "fuller" or "thicker". ----@field compressor integer # Decreases the dynamic range of the sound, making the loud and quiet parts closer in volume, producing a more uniform amplitude throughout time. ----@field distortion integer # Alters the sound by amplifying it until it clips, shearing off parts of the signal, leading to a compressed and distorted sound. ----@field echo integer # Decaying feedback based effect, on the order of seconds. Also known as delay; causes the sound to repeat at regular intervals at a decreasing volume. ----@field equalizer integer # Adjust the frequency components of the sound using a 4-band (low-shelf, two band-pass and a high-shelf) equalizer. ----@field flanger integer # Plays two copies of the sound; while varying the phase, or equivalently delaying one of them, by amounts on the order of milliseconds, resulting in phasing sounds. ----@field reverb integer # Decaying feedback based effect, on the order of milliseconds. Used to simulate the reflection off of the surroundings. ----@field ringmodulator integer # An implementation of amplitude modulation; multiplies the source signal with a simple waveform, to produce either volume changes, or inharmonic overtones. +--- +---Plays multiple copies of the sound with slight pitch and time variation. Used to make sounds sound "fuller" or "thicker". +--- +---@field chorus integer +--- +---Decreases the dynamic range of the sound, making the loud and quiet parts closer in volume, producing a more uniform amplitude throughout time. +--- +---@field compressor integer +--- +---Alters the sound by amplifying it until it clips, shearing off parts of the signal, leading to a compressed and distorted sound. +--- +---@field distortion integer +--- +---Decaying feedback based effect, on the order of seconds. Also known as delay; causes the sound to repeat at regular intervals at a decreasing volume. +--- +---@field echo integer +--- +---Adjust the frequency components of the sound using a 4-band (low-shelf, two band-pass and a high-shelf) equalizer. +--- +---@field equalizer integer +--- +---Plays two copies of the sound; while varying the phase, or equivalently delaying one of them, by amounts on the order of milliseconds, resulting in phasing sounds. +--- +---@field flanger integer +--- +---Decaying feedback based effect, on the order of milliseconds. Used to simulate the reflection off of the surroundings. +--- +---@field reverb integer +--- +---An implementation of amplitude modulation; multiplies the source signal with a simple waveform, to produce either volume changes, or inharmonic overtones. +--- +---@field ringmodulator integer +--- +---The different types of waveforms that can be used with the '''ringmodulator''' EffectType. +--- ---@class love.EffectWaveform ----@field sawtooth integer # A sawtooth wave, also known as a ramp wave. Named for its linear rise, and (near-)instantaneous fall along time. ----@field sine integer # A sine wave. Follows a trigonometric sine function. ----@field square integer # A square wave. Switches between high and low states (near-)instantaneously. ----@field triangle integer # A triangle wave. Follows a linear rise and fall that repeats periodically. +--- +---A sawtooth wave, also known as a ramp wave. Named for its linear rise, and (near-)instantaneous fall along time. +--- +---@field sawtooth integer +--- +---A sine wave. Follows a trigonometric sine function. +--- +---@field sine integer +--- +---A square wave. Switches between high and low states (near-)instantaneously. +--- +---@field square integer +--- +---A triangle wave. Follows a linear rise and fall that repeats periodically. +--- +---@field triangle integer +--- +---Types of filters for Sources. +--- ---@class love.FilterType ----@field lowpass integer # Low-pass filter. High frequency sounds are attenuated. ----@field highpass integer # High-pass filter. Low frequency sounds are attenuated. ----@field bandpass integer # Band-pass filter. Both high and low frequency sounds are attenuated based on the given parameters. +--- +---Low-pass filter. High frequency sounds are attenuated. +--- +---@field lowpass integer +--- +---High-pass filter. Low frequency sounds are attenuated. +--- +---@field highpass integer +--- +---Band-pass filter. Both high and low frequency sounds are attenuated based on the given parameters. +--- +---@field bandpass integer +--- +---Types of audio sources. +--- +---A good rule of thumb is to use stream for music files and static for all short sound effects. Basically, you want to avoid loading large files into memory at once. +--- ---@class love.SourceType ----@field static integer # The whole audio is decoded. ----@field stream integer # The audio is decoded in chunks when needed. ----@field queue integer # The audio must be manually queued by the user. +--- +---The whole audio is decoded. +--- +---@field static integer +--- +---The audio is decoded in chunks when needed. +--- +---@field stream integer +--- +---The audio must be manually queued by the user. +--- +---@field queue integer +--- +---Units that represent time. +--- ---@class love.TimeUnit ----@field seconds integer # Regular seconds. ----@field samples integer # Audio samples. +--- +---Regular seconds. +--- +---@field seconds integer +--- +---Audio samples. +--- +---@field samples integer diff --git a/meta/3rd/love2d/library/love.data.lua b/meta/3rd/love2d/library/love.data.lua index 1bde844e..cf77444a 100644 --- a/meta/3rd/love2d/library/love.data.lua +++ b/meta/3rd/love2d/library/love.data.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.data love.data = {} @@ -98,9 +99,19 @@ function love.data.pack(container, format, v1) end ---@return number index # The index of the first unread byte in the data string. function love.data.unpack(format, datastring, pos) end +--- +---Data object containing arbitrary bytes in an contiguous memory. +--- +---There are currently no LÖVE functions provided for manipulating the contents of a ByteData, but Data:getPointer can be used with LuaJIT's FFI to access and write to the contents directly. +--- ---@class love.ByteData: love.Object, love.Data local ByteData = {} +--- +---Represents byte data compressed using a specific algorithm. +--- +---love.data.decompress can be used to de-compress the data (or love.math.decompress in 0.10.2 or earlier). +--- ---@class love.CompressedData: love.Data, love.Object local CompressedData = {} @@ -110,24 +121,78 @@ local CompressedData = {} ---@return love.CompressedDataFormat format # The format of the CompressedData. function CompressedData:getFormat() end +--- +---Compressed data formats. +--- ---@class love.CompressedDataFormat ----@field lz4 integer # The LZ4 compression format. Compresses and decompresses very quickly, but the compression ratio is not the best. LZ4-HC is used when compression level 9 is specified. Some benchmarks are available here. ----@field zlib integer # The zlib format is DEFLATE-compressed data with a small bit of header data. Compresses relatively slowly and decompresses moderately quickly, and has a decent compression ratio. ----@field gzip integer # The gzip format is DEFLATE-compressed data with a slightly larger header than zlib. Since it uses DEFLATE it has the same compression characteristics as the zlib format. ----@field deflate integer # Raw DEFLATE-compressed data (no header). +--- +---The LZ4 compression format. Compresses and decompresses very quickly, but the compression ratio is not the best. LZ4-HC is used when compression level 9 is specified. Some benchmarks are available here. +--- +---@field lz4 integer +--- +---The zlib format is DEFLATE-compressed data with a small bit of header data. Compresses relatively slowly and decompresses moderately quickly, and has a decent compression ratio. +--- +---@field zlib integer +--- +---The gzip format is DEFLATE-compressed data with a slightly larger header than zlib. Since it uses DEFLATE it has the same compression characteristics as the zlib format. +--- +---@field gzip integer +--- +---Raw DEFLATE-compressed data (no header). +--- +---@field deflate integer +--- +---Return type of various data-returning functions. +--- ---@class love.ContainerType ----@field data integer # Return type is ByteData. ----@field string integer # Return type is string. +--- +---Return type is ByteData. +--- +---@field data integer +--- +---Return type is string. +--- +---@field string integer +--- +---Encoding format used to encode or decode data. +--- ---@class love.EncodeFormat ----@field base64 integer # Encode/decode data as base64 binary-to-text encoding. ----@field hex integer # Encode/decode data as hexadecimal string. +--- +---Encode/decode data as base64 binary-to-text encoding. +--- +---@field base64 integer +--- +---Encode/decode data as hexadecimal string. +--- +---@field hex integer +--- +---Hash algorithm of love.data.hash. +--- ---@class love.HashFunction ----@field md5 integer # MD5 hash algorithm (16 bytes). ----@field sha1 integer # SHA1 hash algorithm (20 bytes). ----@field sha224 integer # SHA2 hash algorithm with message digest size of 224 bits (28 bytes). ----@field sha256 integer # SHA2 hash algorithm with message digest size of 256 bits (32 bytes). ----@field sha384 integer # SHA2 hash algorithm with message digest size of 384 bits (48 bytes). ----@field sha512 integer # SHA2 hash algorithm with message digest size of 512 bits (64 bytes). +--- +---MD5 hash algorithm (16 bytes). +--- +---@field md5 integer +--- +---SHA1 hash algorithm (20 bytes). +--- +---@field sha1 integer +--- +---SHA2 hash algorithm with message digest size of 224 bits (28 bytes). +--- +---@field sha224 integer +--- +---SHA2 hash algorithm with message digest size of 256 bits (32 bytes). +--- +---@field sha256 integer +--- +---SHA2 hash algorithm with message digest size of 384 bits (48 bytes). +--- +---@field sha384 integer +--- +---SHA2 hash algorithm with message digest size of 512 bits (64 bytes). +--- +---@field sha512 integer diff --git a/meta/3rd/love2d/library/love.event.lua b/meta/3rd/love2d/library/love.event.lua index 14db517b..aa06c47f 100644 --- a/meta/3rd/love2d/library/love.event.lua +++ b/meta/3rd/love2d/library/love.event.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.event love.event = {} @@ -44,41 +45,157 @@ function love.event.quit(exitstatus) end --- function love.event.wait() end +--- +---Arguments to love.event.push() and the like. +--- +---Since 0.8.0, event names are no longer abbreviated. +--- ---@class love.Event ----@field focus integer # Window focus gained or lost ----@field joystickpressed integer # Joystick pressed ----@field joystickreleased integer # Joystick released ----@field keypressed integer # Key pressed ----@field keyreleased integer # Key released ----@field mousepressed integer # Mouse pressed ----@field mousereleased integer # Mouse released ----@field quit integer # Quit ----@field resize integer # Window size changed by the user ----@field visible integer # Window is minimized or un-minimized by the user ----@field mousefocus integer # Window mouse focus gained or lost ----@field threaderror integer # A Lua error has occurred in a thread ----@field joystickadded integer # Joystick connected ----@field joystickremoved integer # Joystick disconnected ----@field joystickaxis integer # Joystick axis motion ----@field joystickhat integer # Joystick hat pressed ----@field gamepadpressed integer # Joystick's virtual gamepad button pressed ----@field gamepadreleased integer # Joystick's virtual gamepad button released ----@field gamepadaxis integer # Joystick's virtual gamepad axis moved ----@field textinput integer # User entered text ----@field mousemoved integer # Mouse position changed ----@field lowmemory integer # Running out of memory on mobile devices system ----@field textedited integer # Candidate text for an IME changed ----@field wheelmoved integer # Mouse wheel moved ----@field touchpressed integer # Touch screen touched ----@field touchreleased integer # Touch screen stop touching ----@field touchmoved integer # Touch press moved inside touch screen ----@field directorydropped integer # Directory is dragged and dropped onto the window ----@field filedropped integer # File is dragged and dropped onto the window. ----@field jp integer # Joystick pressed ----@field jr integer # Joystick released ----@field kp integer # Key pressed ----@field kr integer # Key released ----@field mp integer # Mouse pressed ----@field mr integer # Mouse released ----@field q integer # Quit ----@field f integer # Window focus gained or lost +--- +---Window focus gained or lost +--- +---@field focus integer +--- +---Joystick pressed +--- +---@field joystickpressed integer +--- +---Joystick released +--- +---@field joystickreleased integer +--- +---Key pressed +--- +---@field keypressed integer +--- +---Key released +--- +---@field keyreleased integer +--- +---Mouse pressed +--- +---@field mousepressed integer +--- +---Mouse released +--- +---@field mousereleased integer +--- +---Quit +--- +---@field quit integer +--- +---Window size changed by the user +--- +---@field resize integer +--- +---Window is minimized or un-minimized by the user +--- +---@field visible integer +--- +---Window mouse focus gained or lost +--- +---@field mousefocus integer +--- +---A Lua error has occurred in a thread +--- +---@field threaderror integer +--- +---Joystick connected +--- +---@field joystickadded integer +--- +---Joystick disconnected +--- +---@field joystickremoved integer +--- +---Joystick axis motion +--- +---@field joystickaxis integer +--- +---Joystick hat pressed +--- +---@field joystickhat integer +--- +---Joystick's virtual gamepad button pressed +--- +---@field gamepadpressed integer +--- +---Joystick's virtual gamepad button released +--- +---@field gamepadreleased integer +--- +---Joystick's virtual gamepad axis moved +--- +---@field gamepadaxis integer +--- +---User entered text +--- +---@field textinput integer +--- +---Mouse position changed +--- +---@field mousemoved integer +--- +---Running out of memory on mobile devices system +--- +---@field lowmemory integer +--- +---Candidate text for an IME changed +--- +---@field textedited integer +--- +---Mouse wheel moved +--- +---@field wheelmoved integer +--- +---Touch screen touched +--- +---@field touchpressed integer +--- +---Touch screen stop touching +--- +---@field touchreleased integer +--- +---Touch press moved inside touch screen +--- +---@field touchmoved integer +--- +---Directory is dragged and dropped onto the window +--- +---@field directorydropped integer +--- +---File is dragged and dropped onto the window. +--- +---@field filedropped integer +--- +---Joystick pressed +--- +---@field jp integer +--- +---Joystick released +--- +---@field jr integer +--- +---Key pressed +--- +---@field kp integer +--- +---Key released +--- +---@field kr integer +--- +---Mouse pressed +--- +---@field mp integer +--- +---Mouse released +--- +---@field mr integer +--- +---Quit +--- +---@field ["q"] integer +--- +---Window focus gained or lost +--- +---@field ["f"] integer diff --git a/meta/3rd/love2d/library/love.filesystem.lua b/meta/3rd/love2d/library/love.filesystem.lua index 5f6b1d18..6fd71187 100644 --- a/meta/3rd/love2d/library/love.filesystem.lua +++ b/meta/3rd/love2d/library/love.filesystem.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.filesystem love.filesystem = {} @@ -258,9 +259,17 @@ function love.filesystem.unmount(archive) end ---@return string message # Error message if operation was unsuccessful. function love.filesystem.write(name, data, size) end +--- +---Represents a file dropped onto the window. +--- +---Note that the DroppedFile type can only be obtained from love.filedropped callback, and can't be constructed manually by the user. +--- ---@class love.DroppedFile: love.File, love.Object local DroppedFile = {} +--- +---Represents a file on the filesystem. A function that takes a file path can also take a File. +--- ---@class love.File: love.Object local File = {} @@ -369,6 +378,9 @@ function File:tell() end ---@return string err # The error string if an error occurred. function File:write(data, size) end +--- +---Data representing the contents of a file. +--- ---@class love.FileData: love.Data, love.Object local FileData = {} @@ -384,23 +396,74 @@ function FileData:getExtension() end ---@return string name # The name of the file the FileData represents. function FileData:getFilename() end +--- +---Buffer modes for File objects. +--- ---@class love.BufferMode ----@field none integer # No buffering. The result of write and append operations appears immediately. ----@field line integer # Line buffering. Write and append operations are buffered until a newline is output or the buffer size limit is reached. ----@field full integer # Full buffering. Write and append operations are always buffered until the buffer size limit is reached. +--- +---No buffering. The result of write and append operations appears immediately. +--- +---@field none integer +--- +---Line buffering. Write and append operations are buffered until a newline is output or the buffer size limit is reached. +--- +---@field line integer +--- +---Full buffering. Write and append operations are always buffered until the buffer size limit is reached. +--- +---@field full integer +--- +---How to decode a given FileData. +--- ---@class love.FileDecoder ----@field file integer # The data is unencoded. ----@field base64 integer # The data is base64-encoded. +--- +---The data is unencoded. +--- +---@field file integer +--- +---The data is base64-encoded. +--- +---@field base64 integer +--- +---The different modes you can open a File in. +--- ---@class love.FileMode ----@field r integer # Open a file for read. ----@field w integer # Open a file for write. ----@field a integer # Open a file for append. ----@field c integer # Do not open a file (represents a closed file.) +--- +---Open a file for read. +--- +---@field ["r"] integer +--- +---Open a file for write. +--- +---@field ["w"] integer +--- +---Open a file for append. +--- +---@field ["a"] integer +--- +---Do not open a file (represents a closed file.) +--- +---@field ["c"] integer +--- +---The type of a file. +--- ---@class love.FileType ----@field file integer # Regular file. ----@field directory integer # Directory. ----@field symlink integer # Symbolic link. ----@field other integer # Something completely different like a device. +--- +---Regular file. +--- +---@field file integer +--- +---Directory. +--- +---@field directory integer +--- +---Symbolic link. +--- +---@field symlink integer +--- +---Something completely different like a device. +--- +---@field other integer diff --git a/meta/3rd/love2d/library/love.font.lua b/meta/3rd/love2d/library/love.font.lua index e419e5d7..4526ccc8 100644 --- a/meta/3rd/love2d/library/love.font.lua +++ b/meta/3rd/love2d/library/love.font.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.font love.font = {} @@ -45,6 +46,9 @@ function love.font.newRasterizer(filename) end ---@return love.Rasterizer rasterizer # The rasterizer. function love.font.newTrueTypeRasterizer(size, hinting, dpiscale) end +--- +---A GlyphData represents a drawable symbol of a font Rasterizer. +--- ---@class love.GlyphData: love.Data, love.Object local GlyphData = {} @@ -105,6 +109,9 @@ function GlyphData:getHeight() end ---@return number width # Glyph width. function GlyphData:getWidth() end +--- +---A Rasterizer handles font rendering, containing the font data (image or TrueType font) and drawable glyphs. +--- ---@class love.Rasterizer: love.Object local Rasterizer = {} @@ -159,8 +166,23 @@ function Rasterizer:getLineHeight() end ---@return boolean hasGlyphs # Whatever font contains specified glyphs. function Rasterizer:hasGlyphs(glyph1, glyph2) end +--- +---True Type hinting mode. +--- ---@class love.HintingMode ----@field normal integer # Default hinting. Should be preferred for typical antialiased fonts. ----@field light integer # Results in fuzzier text but can sometimes preserve the original glyph shapes of the text better than normal hinting. ----@field mono integer # Results in aliased / unsmoothed text with either full opacity or completely transparent pixels. Should be used when antialiasing is not desired for the font. ----@field none integer # Disables hinting for the font. Results in fuzzier text. +--- +---Default hinting. Should be preferred for typical antialiased fonts. +--- +---@field normal integer +--- +---Results in fuzzier text but can sometimes preserve the original glyph shapes of the text better than normal hinting. +--- +---@field light integer +--- +---Results in aliased / unsmoothed text with either full opacity or completely transparent pixels. Should be used when antialiasing is not desired for the font. +--- +---@field mono integer +--- +---Disables hinting for the font. Results in fuzzier text. +--- +---@field none integer diff --git a/meta/3rd/love2d/library/love.graphics.lua b/meta/3rd/love2d/library/love.graphics.lua index 88ad2410..4ce0e44d 100644 --- a/meta/3rd/love2d/library/love.graphics.lua +++ b/meta/3rd/love2d/library/love.graphics.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.graphics love.graphics = {} @@ -918,6 +919,13 @@ function love.graphics.translate(dx, dy) end ---@return string message # Reason why shader code validation failed (or nil if validation succeded). function love.graphics.validateShader(gles, code) end +--- +---A Canvas is used for off-screen rendering. Think of it as an invisible screen that you can draw to, but that will not be visible until you draw it to the actual visible screen. It is also known as "render to texture". +--- +---By drawing things that do not change position often (such as background items) to the Canvas, and then drawing the entire Canvas instead of each item, you can reduce the number of draw operations performed each frame. +--- +---In versions prior to love.graphics.isSupported("canvas") could be used to check for support at runtime. +--- ---@class love.Canvas: love.Texture, love.Drawable, love.Object local Canvas = {} @@ -968,9 +976,15 @@ function Canvas:newImageData() end ---@param func function # A function performing drawing operations. function Canvas:renderTo(func) end +--- +---Superclass for all things that can be drawn on screen. This is an abstract type that can't be created directly. +--- ---@class love.Drawable: love.Object local Drawable = {} +--- +---Defines the shape of characters that can be drawn onto the screen. +--- ---@class love.Font: love.Object local Font = {} @@ -1079,6 +1093,9 @@ function Font:setFilter(min, mag, anisotropy) end ---@param height number # The new line height. function Font:setLineHeight(height) end +--- +---Drawable image type. +--- ---@class love.Image: love.Texture, love.Drawable, love.Object local Image = {} @@ -1105,6 +1122,9 @@ function Image:isCompressed() end ---@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, reloadmipmaps) end +--- +---A 2D polygon mesh used for drawing arbitrary textured shapes. +--- ---@class love.Mesh: love.Drawable, love.Object local Mesh = {} @@ -1249,6 +1269,13 @@ function Mesh:setVertexMap(map) end ---@param startvertex number # The index of the first vertex to replace. function Mesh:setVertices(vertices, startvertex) end +--- +---A ParticleSystem can be used to create particle effects like fire or smoke. +--- +---The particle system has to be created using update it in the update callback to see any changes in the particles emitted. +--- +---The particle system won't create any particles unless you call setParticleLifetime and setEmissionRate. +--- ---@class love.ParticleSystem: love.Drawable, love.Object local ParticleSystem = {} @@ -1675,6 +1702,11 @@ function ParticleSystem:stop() end ---@param dt number # The time (seconds) since last frame. function ParticleSystem:update(dt) end +--- +---A quadrilateral (a polygon with four sides and four corners) with texture coordinate information. +--- +---Quads can be used to select part of a texture to draw. In this way, one large texture atlas can be loaded, and then split up into sub-images. +--- ---@class love.Quad: love.Object local Quad = {} @@ -1697,6 +1729,11 @@ function Quad:getViewport() end ---@param sh number # The reference height, the height of the Image. (Must be greater than 0.) function Quad:setViewport(sw, sh) end +--- +---A Shader is used for advanced hardware-accelerated pixel or vertex manipulation. These effects are written in a language based on GLSL (OpenGL Shading Language) with a few things simplified for easier coding. +--- +---Potential uses for shaders include HDR/bloom, motion blur, grayscale/invert/sepia/any kind of color effect, reflection/refraction, distortions, bump mapping, and much more! Here is a collection of basic shaders and good starting point to learn: https://github.com/vrld/moonshine +--- ---@class love.Shader: love.Object local Shader = {} @@ -1759,6 +1796,11 @@ function Shader:send(name, number) end ---@param color table # A table with red, green, blue, and optional alpha color components in the range of 1 to send to the extern as a vector. function Shader:sendColor(name, color) end +--- +---Using a single image, draw any number of identical copies of the image using a single call to love.graphics.draw(). This can be used, for example, to draw repeating copies of a single background image with high performance. +--- +---A SpriteBatch can be even more useful when the underlying image is a texture atlas (a single image file containing many independent images); by adding Quads to the batch, different sub-images from within the atlas can be drawn. +--- ---@class love.SpriteBatch: love.Drawable, love.Object local SpriteBatch = {} @@ -1884,6 +1926,9 @@ function SpriteBatch:setLayer(spriteindex, layerindex, sx, sy, ox, oy, kx, ky) e ---@param texture love.Texture # The new Image or Canvas to use for the sprites in the batch. function SpriteBatch:setTexture(texture) end +--- +---Drawable text. +--- ---@class love.Text: love.Drawable, love.Object local Text = {} @@ -1969,6 +2014,9 @@ function Text:setFont(font) end ---@param align love.AlignMode # The alignment of the text. function Text:setf(textstring, wraplimit, align) end +--- +---Superclass for drawable objects which represent a texture. All Textures can be drawn with Quads. This is an abstract type that can't be created directly. +--- ---@class love.Texture: love.Drawable, love.Object local Texture = {} @@ -2142,6 +2190,9 @@ function Texture:setMipmapFilter(filtermode, sharpness) end ---@param depth love.WrapMode # Wrapping mode for the z-axis of a Volume texture. function Texture:setWrap(horiz, vert, depth) end +--- +---A drawable video. +--- ---@class love.Video: love.Drawable, love.Object local Video = {} @@ -2231,154 +2282,522 @@ function Video:setSource(source) end ---@return number seconds # The time in seconds since the beginning of the Video. function Video:tell() end +--- +---Text alignment. +--- ---@class love.AlignMode ----@field center integer # Align text center. ----@field left integer # Align text left. ----@field right integer # Align text right. ----@field justify integer # Align text both left and right. +--- +---Align text center. +--- +---@field center integer +--- +---Align text left. +--- +---@field left integer +--- +---Align text right. +--- +---@field right integer +--- +---Align text both left and right. +--- +---@field justify integer +--- +---Different types of arcs that can be drawn. +--- ---@class love.ArcType ----@field pie integer # The arc is drawn like a slice of pie, with the arc circle connected to the center at its end-points. ----@field open integer # The arc circle's two end-points are unconnected when the arc is drawn as a line. Behaves like the "closed" arc type when the arc is drawn in filled mode. ----@field closed integer # The arc circle's two end-points are connected to each other. +--- +---The arc is drawn like a slice of pie, with the arc circle connected to the center at its end-points. +--- +---@field pie integer +--- +---The arc circle's two end-points are unconnected when the arc is drawn as a line. Behaves like the "closed" arc type when the arc is drawn in filled mode. +--- +---@field open integer +--- +---The arc circle's two end-points are connected to each other. +--- +---@field closed integer +--- +---Types of particle area spread distribution. +--- ---@class love.AreaSpreadDistribution ----@field uniform integer # Uniform distribution. ----@field normal integer # Normal (gaussian) distribution. ----@field ellipse integer # Uniform distribution in an ellipse. ----@field borderellipse integer # Distribution in an ellipse with particles spawning at the edges of the ellipse. ----@field borderrectangle integer # Distribution in a rectangle with particles spawning at the edges of the rectangle. ----@field none integer # No distribution - area spread is disabled. +--- +---Uniform distribution. +--- +---@field uniform integer +--- +---Normal (gaussian) distribution. +--- +---@field normal integer +--- +---Uniform distribution in an ellipse. +--- +---@field ellipse integer +--- +---Distribution in an ellipse with particles spawning at the edges of the ellipse. +--- +---@field borderellipse integer +--- +---Distribution in a rectangle with particles spawning at the edges of the rectangle. +--- +---@field borderrectangle integer +--- +---No distribution - area spread is disabled. +--- +---@field none integer +--- +---Different ways alpha affects color blending. See BlendMode and the BlendMode Formulas for additional notes. +--- ---@class love.BlendAlphaMode ----@field alphamultiply integer # The RGB values of what's drawn are multiplied by the alpha values of those colors during blending. This is the default alpha mode. ----@field premultiplied integer # The RGB values of what's drawn are '''not''' multiplied by the alpha values of those colors during blending. For most blend modes to work correctly with this alpha mode, the colors of a drawn object need to have had their RGB values multiplied by their alpha values at some point previously ("premultiplied alpha"). +--- +---The RGB values of what's drawn are multiplied by the alpha values of those colors during blending. This is the default alpha mode. +--- +---@field alphamultiply integer +--- +---The RGB values of what's drawn are '''not''' multiplied by the alpha values of those colors during blending. For most blend modes to work correctly with this alpha mode, the colors of a drawn object need to have had their RGB values multiplied by their alpha values at some point previously ("premultiplied alpha"). +--- +---@field premultiplied integer +--- +---Different ways to do color blending. See BlendAlphaMode and the BlendMode Formulas for additional notes. +--- ---@class love.BlendMode ----@field alpha integer # Alpha blending (normal). The alpha of what's drawn determines its opacity. ----@field replace integer # The colors of what's drawn completely replace what was on the screen, with no additional blending. The BlendAlphaMode specified in love.graphics.setBlendMode still affects what happens. ----@field screen integer # 'Screen' blending. ----@field add integer # The pixel colors of what's drawn are added to the pixel colors already on the screen. The alpha of the screen is not modified. ----@field subtract integer # The pixel colors of what's drawn are subtracted from the pixel colors already on the screen. The alpha of the screen is not modified. ----@field multiply integer # The pixel colors of what's drawn are multiplied with the pixel colors already on the screen (darkening them). The alpha of drawn objects is multiplied with the alpha of the screen rather than determining how much the colors on the screen are affected, even when the "alphamultiply" BlendAlphaMode is used. ----@field lighten integer # The pixel colors of what's drawn are compared to the existing pixel colors, and the larger of the two values for each color component is used. Only works when the "premultiplied" BlendAlphaMode is used in love.graphics.setBlendMode. ----@field darken integer # The pixel colors of what's drawn are compared to the existing pixel colors, and the smaller of the two values for each color component is used. Only works when the "premultiplied" BlendAlphaMode is used in love.graphics.setBlendMode. ----@field additive integer # Additive blend mode. ----@field subtractive integer # Subtractive blend mode. ----@field multiplicative integer # Multiply blend mode. ----@field premultiplied integer # Premultiplied alpha blend mode. +--- +---Alpha blending (normal). The alpha of what's drawn determines its opacity. +--- +---@field alpha integer +--- +---The colors of what's drawn completely replace what was on the screen, with no additional blending. The BlendAlphaMode specified in love.graphics.setBlendMode still affects what happens. +--- +---@field replace integer +--- +---'Screen' blending. +--- +---@field screen integer +--- +---The pixel colors of what's drawn are added to the pixel colors already on the screen. The alpha of the screen is not modified. +--- +---@field add integer +--- +---The pixel colors of what's drawn are subtracted from the pixel colors already on the screen. The alpha of the screen is not modified. +--- +---@field subtract integer +--- +---The pixel colors of what's drawn are multiplied with the pixel colors already on the screen (darkening them). The alpha of drawn objects is multiplied with the alpha of the screen rather than determining how much the colors on the screen are affected, even when the "alphamultiply" BlendAlphaMode is used. +--- +---@field multiply integer +--- +---The pixel colors of what's drawn are compared to the existing pixel colors, and the larger of the two values for each color component is used. Only works when the "premultiplied" BlendAlphaMode is used in love.graphics.setBlendMode. +--- +---@field lighten integer +--- +---The pixel colors of what's drawn are compared to the existing pixel colors, and the smaller of the two values for each color component is used. Only works when the "premultiplied" BlendAlphaMode is used in love.graphics.setBlendMode. +--- +---@field darken integer +--- +---Additive blend mode. +--- +---@field additive integer +--- +---Subtractive blend mode. +--- +---@field subtractive integer +--- +---Multiply blend mode. +--- +---@field multiplicative integer +--- +---Premultiplied alpha blend mode. +--- +---@field premultiplied integer +--- +---Different types of per-pixel stencil test and depth test comparisons. The pixels of an object will be drawn if the comparison succeeds, for each pixel that the object touches. +--- ---@class love.CompareMode ----@field equal integer # * stencil tests: the stencil value of the pixel must be equal to the supplied value. -* depth tests: the depth value of the drawn object at that pixel must be equal to the existing depth value of that pixel. ----@field notequal integer # * stencil tests: the stencil value of the pixel must not be equal to the supplied value. -* depth tests: the depth value of the drawn object at that pixel must not be equal to the existing depth value of that pixel. ----@field less integer # * stencil tests: the stencil value of the pixel must be less than the supplied value. -* depth tests: the depth value of the drawn object at that pixel must be less than the existing depth value of that pixel. ----@field lequal integer # * stencil tests: the stencil value of the pixel must be less than or equal to the supplied value. -* depth tests: the depth value of the drawn object at that pixel must be less than or equal to the existing depth value of that pixel. ----@field gequal integer # * stencil tests: the stencil value of the pixel must be greater than or equal to the supplied value. -* depth tests: the depth value of the drawn object at that pixel must be greater than or equal to the existing depth value of that pixel. ----@field greater integer # * stencil tests: the stencil value of the pixel must be greater than the supplied value. -* depth tests: the depth value of the drawn object at that pixel must be greater than the existing depth value of that pixel. ----@field never integer # Objects will never be drawn. ----@field always integer # Objects will always be drawn. Effectively disables the depth or stencil test. +--- +---* stencil tests: the stencil value of the pixel must be equal to the supplied value. +---* depth tests: the depth value of the drawn object at that pixel must be equal to the existing depth value of that pixel. +--- +---@field equal integer +--- +---* stencil tests: the stencil value of the pixel must not be equal to the supplied value. +---* depth tests: the depth value of the drawn object at that pixel must not be equal to the existing depth value of that pixel. +--- +---@field notequal integer +--- +---* stencil tests: the stencil value of the pixel must be less than the supplied value. +---* depth tests: the depth value of the drawn object at that pixel must be less than the existing depth value of that pixel. +--- +---@field less integer +--- +---* stencil tests: the stencil value of the pixel must be less than or equal to the supplied value. +---* depth tests: the depth value of the drawn object at that pixel must be less than or equal to the existing depth value of that pixel. +--- +---@field lequal integer +--- +---* stencil tests: the stencil value of the pixel must be greater than or equal to the supplied value. +---* depth tests: the depth value of the drawn object at that pixel must be greater than or equal to the existing depth value of that pixel. +--- +---@field gequal integer +--- +---* stencil tests: the stencil value of the pixel must be greater than the supplied value. +---* depth tests: the depth value of the drawn object at that pixel must be greater than the existing depth value of that pixel. +--- +---@field greater integer +--- +---Objects will never be drawn. +--- +---@field never integer +--- +---Objects will always be drawn. Effectively disables the depth or stencil test. +--- +---@field always integer +--- +---How Mesh geometry is culled when rendering. +--- ---@class love.CullMode ----@field back integer # Back-facing triangles in Meshes are culled (not rendered). The vertex order of a triangle determines whether it is back- or front-facing. ----@field front integer # Front-facing triangles in Meshes are culled. ----@field none integer # Both back- and front-facing triangles in Meshes are rendered. +--- +---Back-facing triangles in Meshes are culled (not rendered). The vertex order of a triangle determines whether it is back- or front-facing. +--- +---@field back integer +--- +---Front-facing triangles in Meshes are culled. +--- +---@field front integer +--- +---Both back- and front-facing triangles in Meshes are rendered. +--- +---@field none integer +--- +---Controls whether shapes are drawn as an outline, or filled. +--- ---@class love.DrawMode ----@field fill integer # Draw filled shape. ----@field line integer # Draw outlined shape. +--- +---Draw filled shape. +--- +---@field fill integer +--- +---Draw outlined shape. +--- +---@field line integer +--- +---How the image is filtered when scaling. +--- ---@class love.FilterMode ----@field linear integer # Scale image with linear interpolation. ----@field nearest integer # Scale image with nearest neighbor interpolation. +--- +---Scale image with linear interpolation. +--- +---@field linear integer +--- +---Scale image with nearest neighbor interpolation. +--- +---@field nearest integer +--- +---Graphics features that can be checked for with love.graphics.getSupported. +--- ---@class love.GraphicsFeature ----@field clampzero integer # Whether the "clampzero" WrapMode is supported. ----@field lighten integer # Whether the "lighten" and "darken" BlendModes are supported. ----@field multicanvasformats integer # Whether multiple formats can be used in the same love.graphics.setCanvas call. ----@field glsl3 integer # Whether GLSL 3 Shaders can be used. ----@field instancing integer # Whether mesh instancing is supported. ----@field fullnpot integer # Whether textures with non-power-of-two dimensions can use mipmapping and the 'repeat' WrapMode. ----@field pixelshaderhighp integer # Whether pixel shaders can use "highp" 32 bit floating point numbers (as opposed to just 16 bit or lower precision). ----@field shaderderivatives integer # Whether shaders can use the dFdx, dFdy, and fwidth functions for computing derivatives. +--- +---Whether the "clampzero" WrapMode is supported. +--- +---@field clampzero integer +--- +---Whether the "lighten" and "darken" BlendModes are supported. +--- +---@field lighten integer +--- +---Whether multiple formats can be used in the same love.graphics.setCanvas call. +--- +---@field multicanvasformats integer +--- +---Whether GLSL 3 Shaders can be used. +--- +---@field glsl3 integer +--- +---Whether mesh instancing is supported. +--- +---@field instancing integer +--- +---Whether textures with non-power-of-two dimensions can use mipmapping and the 'repeat' WrapMode. +--- +---@field fullnpot integer +--- +---Whether pixel shaders can use "highp" 32 bit floating point numbers (as opposed to just 16 bit or lower precision). +--- +---@field pixelshaderhighp integer +--- +---Whether shaders can use the dFdx, dFdy, and fwidth functions for computing derivatives. +--- +---@field shaderderivatives integer +--- +---Types of system-dependent graphics limits checked for using love.graphics.getSystemLimits. +--- ---@class love.GraphicsLimit ----@field pointsize integer # The maximum size of points. ----@field texturesize integer # The maximum width or height of Images and Canvases. ----@field multicanvas integer # The maximum number of simultaneously active canvases (via love.graphics.setCanvas.) ----@field canvasmsaa integer # The maximum number of antialiasing samples for a Canvas. ----@field texturelayers integer # The maximum number of layers in an Array texture. ----@field volumetexturesize integer # The maximum width, height, or depth of a Volume texture. ----@field cubetexturesize integer # The maximum width or height of a Cubemap texture. ----@field anisotropy integer # The maximum amount of anisotropic filtering. Texture:setMipmapFilter internally clamps the given anisotropy value to the system's limit. +--- +---The maximum size of points. +--- +---@field pointsize integer +--- +---The maximum width or height of Images and Canvases. +--- +---@field texturesize integer +--- +---The maximum number of simultaneously active canvases (via love.graphics.setCanvas.) +--- +---@field multicanvas integer +--- +---The maximum number of antialiasing samples for a Canvas. +--- +---@field canvasmsaa integer +--- +---The maximum number of layers in an Array texture. +--- +---@field texturelayers integer +--- +---The maximum width, height, or depth of a Volume texture. +--- +---@field volumetexturesize integer +--- +---The maximum width or height of a Cubemap texture. +--- +---@field cubetexturesize integer +--- +---The maximum amount of anisotropic filtering. Texture:setMipmapFilter internally clamps the given anisotropy value to the system's limit. +--- +---@field anisotropy integer +--- +---Vertex map datatype for Data variant of Mesh:setVertexMap. +--- ---@class love.IndexDataType ----@field uint16 integer # The vertex map is array of unsigned word (16-bit). ----@field uint32 integer # The vertex map is array of unsigned dword (32-bit). +--- +---The vertex map is array of unsigned word (16-bit). +--- +---@field uint16 integer +--- +---The vertex map is array of unsigned dword (32-bit). +--- +---@field uint32 integer +--- +---Line join style. +--- ---@class love.LineJoin ----@field miter integer # The ends of the line segments beveled in an angle so that they join seamlessly. ----@field none integer # No cap applied to the ends of the line segments. ----@field bevel integer # Flattens the point where line segments join together. +--- +---The ends of the line segments beveled in an angle so that they join seamlessly. +--- +---@field miter integer +--- +---No cap applied to the ends of the line segments. +--- +---@field none integer +--- +---Flattens the point where line segments join together. +--- +---@field bevel integer +--- +---The styles in which lines are drawn. +--- ---@class love.LineStyle ----@field rough integer # Draw rough lines. ----@field smooth integer # Draw smooth lines. +--- +---Draw rough lines. +--- +---@field rough integer +--- +---Draw smooth lines. +--- +---@field smooth integer +--- +---How a Mesh's vertices are used when drawing. +--- ---@class love.MeshDrawMode ----@field fan integer # The vertices create a "fan" shape with the first vertex acting as the hub point. Can be easily used to draw simple convex polygons. ----@field strip integer # The vertices create a series of connected triangles using vertices 1, 2, 3, then 3, 2, 4 (note the order), then 3, 4, 5, and so on. ----@field triangles integer # The vertices create unconnected triangles. ----@field points integer # The vertices are drawn as unconnected points (see love.graphics.setPointSize.) +--- +---The vertices create a "fan" shape with the first vertex acting as the hub point. Can be easily used to draw simple convex polygons. +--- +---@field fan integer +--- +---The vertices create a series of connected triangles using vertices 1, 2, 3, then 3, 2, 4 (note the order), then 3, 4, 5, and so on. +--- +---@field strip integer +--- +---The vertices create unconnected triangles. +--- +---@field triangles integer +--- +---The vertices are drawn as unconnected points (see love.graphics.setPointSize.) +--- +---@field points integer +--- +---Controls whether a Canvas has mipmaps, and its behaviour when it does. +--- ---@class love.MipmapMode ----@field none integer # The Canvas has no mipmaps. ----@field auto integer # The Canvas has mipmaps. love.graphics.setCanvas can be used to render to a specific mipmap level, or Canvas:generateMipmaps can (re-)compute all mipmap levels based on the base level. ----@field manual integer # The Canvas has mipmaps, and all mipmap levels will automatically be recomputed when switching away from the Canvas with love.graphics.setCanvas. +--- +---The Canvas has no mipmaps. +--- +---@field none integer +--- +---The Canvas has mipmaps. love.graphics.setCanvas can be used to render to a specific mipmap level, or Canvas:generateMipmaps can (re-)compute all mipmap levels based on the base level. +--- +---@field auto integer +--- +---The Canvas has mipmaps, and all mipmap levels will automatically be recomputed when switching away from the Canvas with love.graphics.setCanvas. +--- +---@field manual integer +--- +---How newly created particles are added to the ParticleSystem. +--- ---@class love.ParticleInsertMode ----@field top integer # Particles are inserted at the top of the ParticleSystem's list of particles. ----@field bottom integer # Particles are inserted at the bottom of the ParticleSystem's list of particles. ----@field random integer # Particles are inserted at random positions in the ParticleSystem's list of particles. +--- +---Particles are inserted at the top of the ParticleSystem's list of particles. +--- +---@field top integer +--- +---Particles are inserted at the bottom of the ParticleSystem's list of particles. +--- +---@field bottom integer +--- +---Particles are inserted at random positions in the ParticleSystem's list of particles. +--- +---@field random integer +--- +---Usage hints for SpriteBatches and Meshes to optimize data storage and access. +--- ---@class love.SpriteBatchUsage ----@field dynamic integer # The object's data will change occasionally during its lifetime. ----@field static integer # The object will not be modified after initial sprites or vertices are added. ----@field stream integer # The object data will always change between draws. +--- +---The object's data will change occasionally during its lifetime. +--- +---@field dynamic integer +--- +---The object will not be modified after initial sprites or vertices are added. +--- +---@field static integer +--- +---The object data will always change between draws. +--- +---@field stream integer +--- +---Graphics state stack types used with love.graphics.push. +--- ---@class love.StackType ----@field transform integer # The transformation stack (love.graphics.translate, love.graphics.rotate, etc.) ----@field all integer # All love.graphics state, including transform state. +--- +---The transformation stack (love.graphics.translate, love.graphics.rotate, etc.) +--- +---@field transform integer +--- +---All love.graphics state, including transform state. +--- +---@field all integer +--- +---How a stencil function modifies the stencil values of pixels it touches. +--- ---@class love.StencilAction ----@field replace integer # The stencil value of a pixel will be replaced by the value specified in love.graphics.stencil, if any object touches the pixel. ----@field increment integer # The stencil value of a pixel will be incremented by 1 for each object that touches the pixel. If the stencil value reaches 255 it will stay at 255. ----@field decrement integer # The stencil value of a pixel will be decremented by 1 for each object that touches the pixel. If the stencil value reaches 0 it will stay at 0. ----@field incrementwrap integer # The stencil value of a pixel will be incremented by 1 for each object that touches the pixel. If a stencil value of 255 is incremented it will be set to 0. ----@field decrementwrap integer # The stencil value of a pixel will be decremented by 1 for each object that touches the pixel. If the stencil value of 0 is decremented it will be set to 255. ----@field invert integer # The stencil value of a pixel will be bitwise-inverted for each object that touches the pixel. If a stencil value of 0 is inverted it will become 255. +--- +---The stencil value of a pixel will be replaced by the value specified in love.graphics.stencil, if any object touches the pixel. +--- +---@field replace integer +--- +---The stencil value of a pixel will be incremented by 1 for each object that touches the pixel. If the stencil value reaches 255 it will stay at 255. +--- +---@field increment integer +--- +---The stencil value of a pixel will be decremented by 1 for each object that touches the pixel. If the stencil value reaches 0 it will stay at 0. +--- +---@field decrement integer +--- +---The stencil value of a pixel will be incremented by 1 for each object that touches the pixel. If a stencil value of 255 is incremented it will be set to 0. +--- +---@field incrementwrap integer +--- +---The stencil value of a pixel will be decremented by 1 for each object that touches the pixel. If the stencil value of 0 is decremented it will be set to 255. +--- +---@field decrementwrap integer +--- +---The stencil value of a pixel will be bitwise-inverted for each object that touches the pixel. If a stencil value of 0 is inverted it will become 255. +--- +---@field invert integer +--- +---Types of textures (2D, cubemap, etc.) +--- ---@class love.TextureType ----@field 2d integer # Regular 2D texture with width and height. ----@field array integer # Several same-size 2D textures organized into a single object. Similar to a texture atlas / sprite sheet, but avoids sprite bleeding and other issues. ----@field cube integer # Cubemap texture with 6 faces. Requires a custom shader (and Shader:send) to use. Sampling from a cube texture in a shader takes a 3D direction vector instead of a texture coordinate. ----@field volume integer # 3D texture with width, height, and depth. Requires a custom shader to use. Volume textures can have texture filtering applied along the 3rd axis. +--- +---Regular 2D texture with width and height. +--- +---@field ["2d"] integer +--- +---Several same-size 2D textures organized into a single object. Similar to a texture atlas / sprite sheet, but avoids sprite bleeding and other issues. +--- +---@field array integer +--- +---Cubemap texture with 6 faces. Requires a custom shader (and Shader:send) to use. Sampling from a cube texture in a shader takes a 3D direction vector instead of a texture coordinate. +--- +---@field cube integer +--- +---3D texture with width, height, and depth. Requires a custom shader to use. Volume textures can have texture filtering applied along the 3rd axis. +--- +---@field volume integer +--- +---The frequency at which a vertex shader fetches the vertex attribute's data from the Mesh when it's drawn. +--- +---Per-instance attributes can be used to render a Mesh many times with different positions, colors, or other attributes via a single love.graphics.drawInstanced call, without using the love_InstanceID vertex shader variable. +--- ---@class love.VertexAttributeStep ----@field pervertex integer # The vertex attribute will have a unique value for each vertex in the Mesh. ----@field perinstance integer # The vertex attribute will have a unique value for each instance of the Mesh. +--- +---The vertex attribute will have a unique value for each vertex in the Mesh. +--- +---@field pervertex integer +--- +---The vertex attribute will have a unique value for each instance of the Mesh. +--- +---@field perinstance integer +--- +---How Mesh geometry vertices are ordered. +--- ---@class love.VertexWinding ----@field cw integer # Clockwise. ----@field ccw integer # Counter-clockwise. +--- +---Clockwise. +--- +---@field cw integer +--- +---Counter-clockwise. +--- +---@field ccw integer +--- +---How the image wraps inside a Quad with a larger quad size than image size. This also affects how Meshes with texture coordinates which are outside the range of 1 are drawn, and the color returned by the Texel Shader function when using it to sample from texture coordinates outside of the range of 1. +--- ---@class love.WrapMode ----@field clamp integer # Clamp the texture. Appears only once. The area outside the texture's normal range is colored based on the edge pixels of the texture. ----@field repeat integer # Repeat the texture. Fills the whole available extent. ----@field mirroredrepeat integer # Repeat the texture, flipping it each time it repeats. May produce better visual results than the repeat mode when the texture doesn't seamlessly tile. ----@field clampzero integer # Clamp the texture. Fills the area outside the texture's normal range with transparent black (or opaque black for textures with no alpha channel.) +--- +---Clamp the texture. Appears only once. The area outside the texture's normal range is colored based on the edge pixels of the texture. +--- +---@field clamp integer +--- +---Repeat the texture. Fills the whole available extent. +--- +---@field repeat integer +--- +---Repeat the texture, flipping it each time it repeats. May produce better visual results than the repeat mode when the texture doesn't seamlessly tile. +--- +---@field mirroredrepeat integer +--- +---Clamp the texture. Fills the area outside the texture's normal range with transparent black (or opaque black for textures with no alpha channel.) +--- +---@field clampzero integer diff --git a/meta/3rd/love2d/library/love.image.lua b/meta/3rd/love2d/library/love.image.lua index 3ec51b98..6e36e8e8 100644 --- a/meta/3rd/love2d/library/love.image.lua +++ b/meta/3rd/love2d/library/love.image.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.image love.image = {} @@ -25,6 +26,13 @@ function love.image.newCompressedData(filename) end ---@return love.ImageData imageData # The new blank ImageData object. Each pixel's color values, (including the alpha values!) will be set to zero. function love.image.newImageData(width, height) end +--- +---Represents compressed image data designed to stay compressed in RAM. +--- +---CompressedImageData encompasses standard compressed texture formats such as DXT1, DXT5, and BC5 / 3Dc. +--- +---You can't draw CompressedImageData directly to the screen. See Image for that. +--- ---@class love.CompressedImageData: love.Data, love.Object local CompressedImageData = {} @@ -59,6 +67,11 @@ function CompressedImageData:getMipmapCount() end ---@return number width # The width of the CompressedImageData. function CompressedImageData:getWidth() end +--- +---Raw (decoded) image data. +--- +---You can't draw ImageData directly to screen. See Image for that. +--- ---@class love.ImageData: love.Data, love.Object local ImageData = {} @@ -145,112 +158,435 @@ function ImageData:paste(source, dx, dy, sx, sy, sw, sh) end --- function ImageData:setPixel() end +--- +---Compressed image data formats. Here and here are a couple overviews of many of the formats. +--- +---Unlike traditional PNG or jpeg, these formats stay compressed in RAM and in the graphics card's VRAM. This is good for saving memory space as well as improving performance, since the graphics card will be able to keep more of the image's pixels in its fast-access cache when drawing it. +--- ---@class love.CompressedImageFormat ----@field DXT1 integer # The DXT1 format. RGB data at 4 bits per pixel (compared to 32 bits for ImageData and regular Images.) Suitable for fully opaque images on desktop systems. ----@field DXT3 integer # The DXT3 format. RGBA data at 8 bits per pixel. Smooth variations in opacity do not mix well with this format. ----@field DXT5 integer # The DXT5 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on desktop systems. ----@field BC4 integer # The BC4 format (also known as 3Dc+ or ATI1.) Stores just the red channel, at 4 bits per pixel. ----@field BC4s integer # The signed variant of the BC4 format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders. ----@field BC5 integer # The BC5 format (also known as 3Dc or ATI2.) Stores red and green channels at 8 bits per pixel. ----@field BC5s integer # The signed variant of the BC5 format. ----@field BC6h integer # The BC6H format. Stores half-precision floating-point RGB data in the range of 65504 at 8 bits per pixel. Suitable for HDR images on desktop systems. ----@field BC6hs integer # The signed variant of the BC6H format. Stores RGB data in the range of +65504. ----@field BC7 integer # The BC7 format (also known as BPTC.) Stores RGB or RGBA data at 8 bits per pixel. ----@field ETC1 integer # The ETC1 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on older Android devices. ----@field ETC2rgb integer # The RGB variant of the ETC2 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on newer mobile devices. ----@field ETC2rgba integer # The RGBA variant of the ETC2 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on newer mobile devices. ----@field ETC2rgba1 integer # The RGBA variant of the ETC2 format where pixels are either fully transparent or fully opaque. RGBA data at 4 bits per pixel. ----@field EACr integer # The single-channel variant of the EAC format. Stores just the red channel, at 4 bits per pixel. ----@field EACrs integer # The signed single-channel variant of the EAC format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders. ----@field EACrg integer # The two-channel variant of the EAC format. Stores red and green channels at 8 bits per pixel. ----@field EACrgs integer # The signed two-channel variant of the EAC format. ----@field PVR1rgb2 integer # The 2 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 2 bits per pixel. Textures compressed with PVRTC1 formats must be square and power-of-two sized. ----@field PVR1rgb4 integer # The 4 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 4 bits per pixel. ----@field PVR1rgba2 integer # The 2 bit per pixel RGBA variant of the PVRTC1 format. ----@field PVR1rgba4 integer # The 4 bit per pixel RGBA variant of the PVRTC1 format. ----@field ASTC4x4 integer # The 4x4 pixels per block variant of the ASTC format. RGBA data at 8 bits per pixel. ----@field ASTC5x4 integer # The 5x4 pixels per block variant of the ASTC format. RGBA data at 6.4 bits per pixel. ----@field ASTC5x5 integer # The 5x5 pixels per block variant of the ASTC format. RGBA data at 5.12 bits per pixel. ----@field ASTC6x5 integer # The 6x5 pixels per block variant of the ASTC format. RGBA data at 4.27 bits per pixel. ----@field ASTC6x6 integer # The 6x6 pixels per block variant of the ASTC format. RGBA data at 3.56 bits per pixel. ----@field ASTC8x5 integer # The 8x5 pixels per block variant of the ASTC format. RGBA data at 3.2 bits per pixel. ----@field ASTC8x6 integer # The 8x6 pixels per block variant of the ASTC format. RGBA data at 2.67 bits per pixel. ----@field ASTC8x8 integer # The 8x8 pixels per block variant of the ASTC format. RGBA data at 2 bits per pixel. ----@field ASTC10x5 integer # The 10x5 pixels per block variant of the ASTC format. RGBA data at 2.56 bits per pixel. ----@field ASTC10x6 integer # The 10x6 pixels per block variant of the ASTC format. RGBA data at 2.13 bits per pixel. ----@field ASTC10x8 integer # The 10x8 pixels per block variant of the ASTC format. RGBA data at 1.6 bits per pixel. ----@field ASTC10x10 integer # The 10x10 pixels per block variant of the ASTC format. RGBA data at 1.28 bits per pixel. ----@field ASTC12x10 integer # The 12x10 pixels per block variant of the ASTC format. RGBA data at 1.07 bits per pixel. ----@field ASTC12x12 integer # The 12x12 pixels per block variant of the ASTC format. RGBA data at 0.89 bits per pixel. +--- +---The DXT1 format. RGB data at 4 bits per pixel (compared to 32 bits for ImageData and regular Images.) Suitable for fully opaque images on desktop systems. +--- +---@field DXT1 integer +--- +---The DXT3 format. RGBA data at 8 bits per pixel. Smooth variations in opacity do not mix well with this format. +--- +---@field DXT3 integer +--- +---The DXT5 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on desktop systems. +--- +---@field DXT5 integer +--- +---The BC4 format (also known as 3Dc+ or ATI1.) Stores just the red channel, at 4 bits per pixel. +--- +---@field BC4 integer +--- +---The signed variant of the BC4 format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders. +--- +---@field BC4s integer +--- +---The BC5 format (also known as 3Dc or ATI2.) Stores red and green channels at 8 bits per pixel. +--- +---@field BC5 integer +--- +---The signed variant of the BC5 format. +--- +---@field BC5s integer +--- +---The BC6H format. Stores half-precision floating-point RGB data in the range of 65504 at 8 bits per pixel. Suitable for HDR images on desktop systems. +--- +---@field BC6h integer +--- +---The signed variant of the BC6H format. Stores RGB data in the range of +65504. +--- +---@field BC6hs integer +--- +---The BC7 format (also known as BPTC.) Stores RGB or RGBA data at 8 bits per pixel. +--- +---@field BC7 integer +--- +---The ETC1 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on older Android devices. +--- +---@field ETC1 integer +--- +---The RGB variant of the ETC2 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on newer mobile devices. +--- +---@field ETC2rgb integer +--- +---The RGBA variant of the ETC2 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on newer mobile devices. +--- +---@field ETC2rgba integer +--- +---The RGBA variant of the ETC2 format where pixels are either fully transparent or fully opaque. RGBA data at 4 bits per pixel. +--- +---@field ETC2rgba1 integer +--- +---The single-channel variant of the EAC format. Stores just the red channel, at 4 bits per pixel. +--- +---@field EACr integer +--- +---The signed single-channel variant of the EAC format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders. +--- +---@field EACrs integer +--- +---The two-channel variant of the EAC format. Stores red and green channels at 8 bits per pixel. +--- +---@field EACrg integer +--- +---The signed two-channel variant of the EAC format. +--- +---@field EACrgs integer +--- +---The 2 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 2 bits per pixel. Textures compressed with PVRTC1 formats must be square and power-of-two sized. +--- +---@field PVR1rgb2 integer +--- +---The 4 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 4 bits per pixel. +--- +---@field PVR1rgb4 integer +--- +---The 2 bit per pixel RGBA variant of the PVRTC1 format. +--- +---@field PVR1rgba2 integer +--- +---The 4 bit per pixel RGBA variant of the PVRTC1 format. +--- +---@field PVR1rgba4 integer +--- +---The 4x4 pixels per block variant of the ASTC format. RGBA data at 8 bits per pixel. +--- +---@field ASTC4x4 integer +--- +---The 5x4 pixels per block variant of the ASTC format. RGBA data at 6.4 bits per pixel. +--- +---@field ASTC5x4 integer +--- +---The 5x5 pixels per block variant of the ASTC format. RGBA data at 5.12 bits per pixel. +--- +---@field ASTC5x5 integer +--- +---The 6x5 pixels per block variant of the ASTC format. RGBA data at 4.27 bits per pixel. +--- +---@field ASTC6x5 integer +--- +---The 6x6 pixels per block variant of the ASTC format. RGBA data at 3.56 bits per pixel. +--- +---@field ASTC6x6 integer +--- +---The 8x5 pixels per block variant of the ASTC format. RGBA data at 3.2 bits per pixel. +--- +---@field ASTC8x5 integer +--- +---The 8x6 pixels per block variant of the ASTC format. RGBA data at 2.67 bits per pixel. +--- +---@field ASTC8x6 integer +--- +---The 8x8 pixels per block variant of the ASTC format. RGBA data at 2 bits per pixel. +--- +---@field ASTC8x8 integer +--- +---The 10x5 pixels per block variant of the ASTC format. RGBA data at 2.56 bits per pixel. +--- +---@field ASTC10x5 integer +--- +---The 10x6 pixels per block variant of the ASTC format. RGBA data at 2.13 bits per pixel. +--- +---@field ASTC10x6 integer +--- +---The 10x8 pixels per block variant of the ASTC format. RGBA data at 1.6 bits per pixel. +--- +---@field ASTC10x8 integer +--- +---The 10x10 pixels per block variant of the ASTC format. RGBA data at 1.28 bits per pixel. +--- +---@field ASTC10x10 integer +--- +---The 12x10 pixels per block variant of the ASTC format. RGBA data at 1.07 bits per pixel. +--- +---@field ASTC12x10 integer +--- +---The 12x12 pixels per block variant of the ASTC format. RGBA data at 0.89 bits per pixel. +--- +---@field ASTC12x12 integer +--- +---Encoded image formats. +--- ---@class love.ImageFormat ----@field tga integer # Targa image format. ----@field png integer # PNG image format. ----@field jpg integer # JPG image format. ----@field bmp integer # BMP image format. +--- +---Targa image format. +--- +---@field tga integer +--- +---PNG image format. +--- +---@field png integer +--- +---JPG image format. +--- +---@field jpg integer +--- +---BMP image format. +--- +---@field bmp integer +--- +---Pixel formats for Textures, ImageData, and CompressedImageData. +--- ---@class love.PixelFormat ----@field unknown integer # Indicates unknown pixel format, used internally. ----@field normal integer # Alias for rgba8, or srgba8 if gamma-correct rendering is enabled. ----@field hdr integer # A format suitable for high dynamic range content - an alias for the rgba16f format, normally. ----@field r8 integer # Single-channel (red component) format (8 bpp). ----@field rg8 integer # Two channels (red and green components) with 8 bits per channel (16 bpp). ----@field rgba8 integer # 8 bits per channel (32 bpp) RGBA. Color channel values range from 0-255 (0-1 in shaders). ----@field srgba8 integer # gamma-correct version of rgba8. ----@field r16 integer # Single-channel (red component) format (16 bpp). ----@field rg16 integer # Two channels (red and green components) with 16 bits per channel (32 bpp). ----@field rgba16 integer # 16 bits per channel (64 bpp) RGBA. Color channel values range from 0-65535 (0-1 in shaders). ----@field r16f integer # Floating point single-channel format (16 bpp). Color values can range from [-65504, +65504]. ----@field rg16f integer # Floating point two-channel format with 16 bits per channel (32 bpp). Color values can range from [-65504, +65504]. ----@field rgba16f integer # Floating point RGBA with 16 bits per channel (64 bpp). Color values can range from [-65504, +65504]. ----@field r32f integer # Floating point single-channel format (32 bpp). ----@field rg32f integer # Floating point two-channel format with 32 bits per channel (64 bpp). ----@field rgba32f integer # Floating point RGBA with 32 bits per channel (128 bpp). ----@field la8 integer # Same as rg8, but accessed as (L, L, L, A) ----@field rgba4 integer # 4 bits per channel (16 bpp) RGBA. ----@field rgb5a1 integer # RGB with 5 bits each, and a 1-bit alpha channel (16 bpp). ----@field rgb565 integer # RGB with 5, 6, and 5 bits each, respectively (16 bpp). There is no alpha channel in this format. ----@field rgb10a2 integer # RGB with 10 bits per channel, and a 2-bit alpha channel (32 bpp). ----@field rg11b10f integer # Floating point RGB with 11 bits in the red and green channels, and 10 bits in the blue channel (32 bpp). There is no alpha channel. Color values can range from [0, +65024]. ----@field stencil8 integer # No depth buffer and 8-bit stencil buffer. ----@field depth16 integer # 16-bit depth buffer and no stencil buffer. ----@field depth24 integer # 24-bit depth buffer and no stencil buffer. ----@field depth32f integer # 32-bit float depth buffer and no stencil buffer. ----@field depth24stencil8 integer # 24-bit depth buffer and 8-bit stencil buffer. ----@field depth32fstencil8 integer # 32-bit float depth buffer and 8-bit stencil buffer. ----@field DXT1 integer # The DXT1 format. RGB data at 4 bits per pixel (compared to 32 bits for ImageData and regular Images.) Suitable for fully opaque images on desktop systems. ----@field DXT3 integer # The DXT3 format. RGBA data at 8 bits per pixel. Smooth variations in opacity do not mix well with this format. ----@field DXT5 integer # The DXT5 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on desktop systems. ----@field BC4 integer # The BC4 format (also known as 3Dc+ or ATI1.) Stores just the red channel, at 4 bits per pixel. ----@field BC4s integer # The signed variant of the BC4 format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders. ----@field BC5 integer # The BC5 format (also known as 3Dc or ATI2.) Stores red and green channels at 8 bits per pixel. ----@field BC5s integer # The signed variant of the BC5 format. ----@field BC6h integer # The BC6H format. Stores half-precision floating-point RGB data in the range of 65504 at 8 bits per pixel. Suitable for HDR images on desktop systems. ----@field BC6hs integer # The signed variant of the BC6H format. Stores RGB data in the range of +65504. ----@field BC7 integer # The BC7 format (also known as BPTC.) Stores RGB or RGBA data at 8 bits per pixel. ----@field ETC1 integer # The ETC1 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on older Android devices. ----@field ETC2rgb integer # The RGB variant of the ETC2 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on newer mobile devices. ----@field ETC2rgba integer # The RGBA variant of the ETC2 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on newer mobile devices. ----@field ETC2rgba1 integer # The RGBA variant of the ETC2 format where pixels are either fully transparent or fully opaque. RGBA data at 4 bits per pixel. ----@field EACr integer # The single-channel variant of the EAC format. Stores just the red channel, at 4 bits per pixel. ----@field EACrs integer # The signed single-channel variant of the EAC format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders. ----@field EACrg integer # The two-channel variant of the EAC format. Stores red and green channels at 8 bits per pixel. ----@field EACrgs integer # The signed two-channel variant of the EAC format. ----@field PVR1rgb2 integer # The 2 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 2 bits per pixel. Textures compressed with PVRTC1 formats must be square and power-of-two sized. ----@field PVR1rgb4 integer # The 4 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 4 bits per pixel. ----@field PVR1rgba2 integer # The 2 bit per pixel RGBA variant of the PVRTC1 format. ----@field PVR1rgba4 integer # The 4 bit per pixel RGBA variant of the PVRTC1 format. ----@field ASTC4x4 integer # The 4x4 pixels per block variant of the ASTC format. RGBA data at 8 bits per pixel. ----@field ASTC5x4 integer # The 5x4 pixels per block variant of the ASTC format. RGBA data at 6.4 bits per pixel. ----@field ASTC5x5 integer # The 5x5 pixels per block variant of the ASTC format. RGBA data at 5.12 bits per pixel. ----@field ASTC6x5 integer # The 6x5 pixels per block variant of the ASTC format. RGBA data at 4.27 bits per pixel. ----@field ASTC6x6 integer # The 6x6 pixels per block variant of the ASTC format. RGBA data at 3.56 bits per pixel. ----@field ASTC8x5 integer # The 8x5 pixels per block variant of the ASTC format. RGBA data at 3.2 bits per pixel. ----@field ASTC8x6 integer # The 8x6 pixels per block variant of the ASTC format. RGBA data at 2.67 bits per pixel. ----@field ASTC8x8 integer # The 8x8 pixels per block variant of the ASTC format. RGBA data at 2 bits per pixel. ----@field ASTC10x5 integer # The 10x5 pixels per block variant of the ASTC format. RGBA data at 2.56 bits per pixel. ----@field ASTC10x6 integer # The 10x6 pixels per block variant of the ASTC format. RGBA data at 2.13 bits per pixel. ----@field ASTC10x8 integer # The 10x8 pixels per block variant of the ASTC format. RGBA data at 1.6 bits per pixel. ----@field ASTC10x10 integer # The 10x10 pixels per block variant of the ASTC format. RGBA data at 1.28 bits per pixel. ----@field ASTC12x10 integer # The 12x10 pixels per block variant of the ASTC format. RGBA data at 1.07 bits per pixel. ----@field ASTC12x12 integer # The 12x12 pixels per block variant of the ASTC format. RGBA data at 0.89 bits per pixel. +--- +---Indicates unknown pixel format, used internally. +--- +---@field unknown integer +--- +---Alias for rgba8, or srgba8 if gamma-correct rendering is enabled. +--- +---@field normal integer +--- +---A format suitable for high dynamic range content - an alias for the rgba16f format, normally. +--- +---@field hdr integer +--- +---Single-channel (red component) format (8 bpp). +--- +---@field r8 integer +--- +---Two channels (red and green components) with 8 bits per channel (16 bpp). +--- +---@field rg8 integer +--- +---8 bits per channel (32 bpp) RGBA. Color channel values range from 0-255 (0-1 in shaders). +--- +---@field rgba8 integer +--- +---gamma-correct version of rgba8. +--- +---@field srgba8 integer +--- +---Single-channel (red component) format (16 bpp). +--- +---@field r16 integer +--- +---Two channels (red and green components) with 16 bits per channel (32 bpp). +--- +---@field rg16 integer +--- +---16 bits per channel (64 bpp) RGBA. Color channel values range from 0-65535 (0-1 in shaders). +--- +---@field rgba16 integer +--- +---Floating point single-channel format (16 bpp). Color values can range from [-65504, +65504]. +--- +---@field r16f integer +--- +---Floating point two-channel format with 16 bits per channel (32 bpp). Color values can range from [-65504, +65504]. +--- +---@field rg16f integer +--- +---Floating point RGBA with 16 bits per channel (64 bpp). Color values can range from [-65504, +65504]. +--- +---@field rgba16f integer +--- +---Floating point single-channel format (32 bpp). +--- +---@field r32f integer +--- +---Floating point two-channel format with 32 bits per channel (64 bpp). +--- +---@field rg32f integer +--- +---Floating point RGBA with 32 bits per channel (128 bpp). +--- +---@field rgba32f integer +--- +---Same as rg8, but accessed as (L, L, L, A) +--- +---@field la8 integer +--- +---4 bits per channel (16 bpp) RGBA. +--- +---@field rgba4 integer +--- +---RGB with 5 bits each, and a 1-bit alpha channel (16 bpp). +--- +---@field rgb5a1 integer +--- +---RGB with 5, 6, and 5 bits each, respectively (16 bpp). There is no alpha channel in this format. +--- +---@field rgb565 integer +--- +---RGB with 10 bits per channel, and a 2-bit alpha channel (32 bpp). +--- +---@field rgb10a2 integer +--- +---Floating point RGB with 11 bits in the red and green channels, and 10 bits in the blue channel (32 bpp). There is no alpha channel. Color values can range from [0, +65024]. +--- +---@field rg11b10f integer +--- +---No depth buffer and 8-bit stencil buffer. +--- +---@field stencil8 integer +--- +---16-bit depth buffer and no stencil buffer. +--- +---@field depth16 integer +--- +---24-bit depth buffer and no stencil buffer. +--- +---@field depth24 integer +--- +---32-bit float depth buffer and no stencil buffer. +--- +---@field depth32f integer +--- +---24-bit depth buffer and 8-bit stencil buffer. +--- +---@field depth24stencil8 integer +--- +---32-bit float depth buffer and 8-bit stencil buffer. +--- +---@field depth32fstencil8 integer +--- +---The DXT1 format. RGB data at 4 bits per pixel (compared to 32 bits for ImageData and regular Images.) Suitable for fully opaque images on desktop systems. +--- +---@field DXT1 integer +--- +---The DXT3 format. RGBA data at 8 bits per pixel. Smooth variations in opacity do not mix well with this format. +--- +---@field DXT3 integer +--- +---The DXT5 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on desktop systems. +--- +---@field DXT5 integer +--- +---The BC4 format (also known as 3Dc+ or ATI1.) Stores just the red channel, at 4 bits per pixel. +--- +---@field BC4 integer +--- +---The signed variant of the BC4 format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders. +--- +---@field BC4s integer +--- +---The BC5 format (also known as 3Dc or ATI2.) Stores red and green channels at 8 bits per pixel. +--- +---@field BC5 integer +--- +---The signed variant of the BC5 format. +--- +---@field BC5s integer +--- +---The BC6H format. Stores half-precision floating-point RGB data in the range of 65504 at 8 bits per pixel. Suitable for HDR images on desktop systems. +--- +---@field BC6h integer +--- +---The signed variant of the BC6H format. Stores RGB data in the range of +65504. +--- +---@field BC6hs integer +--- +---The BC7 format (also known as BPTC.) Stores RGB or RGBA data at 8 bits per pixel. +--- +---@field BC7 integer +--- +---The ETC1 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on older Android devices. +--- +---@field ETC1 integer +--- +---The RGB variant of the ETC2 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on newer mobile devices. +--- +---@field ETC2rgb integer +--- +---The RGBA variant of the ETC2 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on newer mobile devices. +--- +---@field ETC2rgba integer +--- +---The RGBA variant of the ETC2 format where pixels are either fully transparent or fully opaque. RGBA data at 4 bits per pixel. +--- +---@field ETC2rgba1 integer +--- +---The single-channel variant of the EAC format. Stores just the red channel, at 4 bits per pixel. +--- +---@field EACr integer +--- +---The signed single-channel variant of the EAC format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders. +--- +---@field EACrs integer +--- +---The two-channel variant of the EAC format. Stores red and green channels at 8 bits per pixel. +--- +---@field EACrg integer +--- +---The signed two-channel variant of the EAC format. +--- +---@field EACrgs integer +--- +---The 2 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 2 bits per pixel. Textures compressed with PVRTC1 formats must be square and power-of-two sized. +--- +---@field PVR1rgb2 integer +--- +---The 4 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 4 bits per pixel. +--- +---@field PVR1rgb4 integer +--- +---The 2 bit per pixel RGBA variant of the PVRTC1 format. +--- +---@field PVR1rgba2 integer +--- +---The 4 bit per pixel RGBA variant of the PVRTC1 format. +--- +---@field PVR1rgba4 integer +--- +---The 4x4 pixels per block variant of the ASTC format. RGBA data at 8 bits per pixel. +--- +---@field ASTC4x4 integer +--- +---The 5x4 pixels per block variant of the ASTC format. RGBA data at 6.4 bits per pixel. +--- +---@field ASTC5x4 integer +--- +---The 5x5 pixels per block variant of the ASTC format. RGBA data at 5.12 bits per pixel. +--- +---@field ASTC5x5 integer +--- +---The 6x5 pixels per block variant of the ASTC format. RGBA data at 4.27 bits per pixel. +--- +---@field ASTC6x5 integer +--- +---The 6x6 pixels per block variant of the ASTC format. RGBA data at 3.56 bits per pixel. +--- +---@field ASTC6x6 integer +--- +---The 8x5 pixels per block variant of the ASTC format. RGBA data at 3.2 bits per pixel. +--- +---@field ASTC8x5 integer +--- +---The 8x6 pixels per block variant of the ASTC format. RGBA data at 2.67 bits per pixel. +--- +---@field ASTC8x6 integer +--- +---The 8x8 pixels per block variant of the ASTC format. RGBA data at 2 bits per pixel. +--- +---@field ASTC8x8 integer +--- +---The 10x5 pixels per block variant of the ASTC format. RGBA data at 2.56 bits per pixel. +--- +---@field ASTC10x5 integer +--- +---The 10x6 pixels per block variant of the ASTC format. RGBA data at 2.13 bits per pixel. +--- +---@field ASTC10x6 integer +--- +---The 10x8 pixels per block variant of the ASTC format. RGBA data at 1.6 bits per pixel. +--- +---@field ASTC10x8 integer +--- +---The 10x10 pixels per block variant of the ASTC format. RGBA data at 1.28 bits per pixel. +--- +---@field ASTC10x10 integer +--- +---The 12x10 pixels per block variant of the ASTC format. RGBA data at 1.07 bits per pixel. +--- +---@field ASTC12x10 integer +--- +---The 12x12 pixels per block variant of the ASTC format. RGBA data at 0.89 bits per pixel. +--- +---@field ASTC12x12 integer diff --git a/meta/3rd/love2d/library/love.joystick.lua b/meta/3rd/love2d/library/love.joystick.lua index bf353ff2..a1995b8b 100644 --- a/meta/3rd/love2d/library/love.joystick.lua +++ b/meta/3rd/love2d/library/love.joystick.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.joystick love.joystick = {} @@ -56,6 +57,9 @@ function love.joystick.saveGamepadMappings(filename) end ---@return boolean success # Whether the virtual gamepad button was successfully bound. function love.joystick.setGamepadMapping(guid, button, inputtype, inputindex, hatdir) end +--- +---Represents a physical joystick. +--- ---@class love.Joystick: love.Object local Joystick = {} @@ -203,43 +207,154 @@ function Joystick:isVibrationSupported() end ---@return boolean success # True if the vibration was successfully applied, false if not. function Joystick:setVibration(left, right) end +--- +---Virtual gamepad axes. +--- ---@class love.GamepadAxis ----@field leftx integer # The x-axis of the left thumbstick. ----@field lefty integer # The y-axis of the left thumbstick. ----@field rightx integer # The x-axis of the right thumbstick. ----@field righty integer # The y-axis of the right thumbstick. ----@field triggerleft integer # Left analog trigger. ----@field triggerright integer # Right analog trigger. +--- +---The x-axis of the left thumbstick. +--- +---@field leftx integer +--- +---The y-axis of the left thumbstick. +--- +---@field lefty integer +--- +---The x-axis of the right thumbstick. +--- +---@field rightx integer +--- +---The y-axis of the right thumbstick. +--- +---@field righty integer +--- +---Left analog trigger. +--- +---@field triggerleft integer +--- +---Right analog trigger. +--- +---@field triggerright integer +--- +---Virtual gamepad buttons. +--- ---@class love.GamepadButton ----@field a integer # Bottom face button (A). ----@field b integer # Right face button (B). ----@field x integer # Left face button (X). ----@field y integer # Top face button (Y). ----@field back integer # Back button. ----@field guide integer # Guide button. ----@field start integer # Start button. ----@field leftstick integer # Left stick click button. ----@field rightstick integer # Right stick click button. ----@field leftshoulder integer # Left bumper. ----@field rightshoulder integer # Right bumper. ----@field dpup integer # D-pad up. ----@field dpdown integer # D-pad down. ----@field dpleft integer # D-pad left. ----@field dpright integer # D-pad right. +--- +---Bottom face button (A). +--- +---@field ["a"] integer +--- +---Right face button (B). +--- +---@field ["b"] integer +--- +---Left face button (X). +--- +---@field ["x"] integer +--- +---Top face button (Y). +--- +---@field ["y"] integer +--- +---Back button. +--- +---@field back integer +--- +---Guide button. +--- +---@field guide integer +--- +---Start button. +--- +---@field start integer +--- +---Left stick click button. +--- +---@field leftstick integer +--- +---Right stick click button. +--- +---@field rightstick integer +--- +---Left bumper. +--- +---@field leftshoulder integer +--- +---Right bumper. +--- +---@field rightshoulder integer +--- +---D-pad up. +--- +---@field dpup integer +--- +---D-pad down. +--- +---@field dpdown integer +--- +---D-pad left. +--- +---@field dpleft integer +--- +---D-pad right. +--- +---@field dpright integer +--- +---Joystick hat positions. +--- ---@class love.JoystickHat ----@field c integer # Centered ----@field d integer # Down ----@field l integer # Left ----@field ld integer # Left+Down ----@field lu integer # Left+Up ----@field r integer # Right ----@field rd integer # Right+Down ----@field ru integer # Right+Up ----@field u integer # Up +--- +---Centered +--- +---@field ["c"] integer +--- +---Down +--- +---@field ["d"] integer +--- +---Left +--- +---@field ["l"] integer +--- +---Left+Down +--- +---@field ld integer +--- +---Left+Up +--- +---@field lu integer +--- +---Right +--- +---@field ["r"] integer +--- +---Right+Down +--- +---@field rd integer +--- +---Right+Up +--- +---@field ru integer +--- +---Up +--- +---@field ["u"] integer +--- +---Types of Joystick inputs. +--- ---@class love.JoystickInputType ----@field axis integer # Analog axis. ----@field button integer # Button. ----@field hat integer # 8-direction hat value. +--- +---Analog axis. +--- +---@field axis integer +--- +---Button. +--- +---@field button integer +--- +---8-direction hat value. +--- +---@field hat integer diff --git a/meta/3rd/love2d/library/love.keyboard.lua b/meta/3rd/love2d/library/love.keyboard.lua index fe6dfdfe..70f4d45f 100644 --- a/meta/3rd/love2d/library/love.keyboard.lua +++ b/meta/3rd/love2d/library/love.keyboard.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.keyboard love.keyboard = {} @@ -73,344 +74,1370 @@ function love.keyboard.setKeyRepeat(enable) end ---@param enable boolean # Whether text input events should be enabled. function love.keyboard.setTextInput(enable) end +--- +---All the keys you can press. Note that some keys may not be available on your keyboard or system. +--- ---@class love.KeyConstant ----@field a integer # The A key ----@field b integer # The B key ----@field c integer # The C key ----@field d integer # The D key ----@field e integer # The E key ----@field f integer # The F key ----@field g integer # The G key ----@field h integer # The H key ----@field i integer # The I key ----@field j integer # The J key ----@field k integer # The K key ----@field l integer # The L key ----@field m integer # The M key ----@field n integer # The N key ----@field o integer # The O key ----@field p integer # The P key ----@field q integer # The Q key ----@field r integer # The R key ----@field s integer # The S key ----@field t integer # The T key ----@field u integer # The U key ----@field v integer # The V key ----@field w integer # The W key ----@field x integer # The X key ----@field y integer # The Y key ----@field z integer # The Z key ----@field 0 integer # The zero key ----@field 1 integer # The one key ----@field 2 integer # The two key ----@field 3 integer # The three key ----@field 4 integer # The four key ----@field 5 integer # The five key ----@field 6 integer # The six key ----@field 7 integer # The seven key ----@field 8 integer # The eight key ----@field 9 integer # The nine key ----@field space integer # Space key ----@field ! integer # Exclamation mark key ----@field " integer # Double quote key ----@field # integer # Hash key ----@field $ integer # Dollar key ----@field & integer # Ampersand key ----@field ' integer # Single quote key ----@field ( integer # Left parenthesis key ----@field ) integer # Right parenthesis key ----@field * integer # Asterisk key ----@field + integer # Plus key ----@field , integer # Comma key ----@field - integer # Hyphen-minus key ----@field . integer # Full stop key ----@field / integer # Slash key ----@field : integer # Colon key ----@field ; integer # Semicolon key ----@field < integer # Less-than key ----@field = integer # Equal key ----@field > integer # Greater-than key ----@field ? integer # Question mark key ----@field @ integer # At sign key ----@field [ integer # Left square bracket key ----@field \ integer # Backslash key ----@field ] integer # Right square bracket key ----@field ^ integer # Caret key ----@field _ integer # Underscore key ----@field ` integer # Grave accent key ----@field kp0 integer # The numpad zero key ----@field kp1 integer # The numpad one key ----@field kp2 integer # The numpad two key ----@field kp3 integer # The numpad three key ----@field kp4 integer # The numpad four key ----@field kp5 integer # The numpad five key ----@field kp6 integer # The numpad six key ----@field kp7 integer # The numpad seven key ----@field kp8 integer # The numpad eight key ----@field kp9 integer # The numpad nine key ----@field kp. integer # The numpad decimal point key ----@field kp/ integer # The numpad division key ----@field kp* integer # The numpad multiplication key ----@field kp- integer # The numpad substraction key ----@field kp+ integer # The numpad addition key ----@field kpenter integer # The numpad enter key ----@field kp= integer # The numpad equals key ----@field up integer # Up cursor key ----@field down integer # Down cursor key ----@field right integer # Right cursor key ----@field left integer # Left cursor key ----@field home integer # Home key ----@field end integer # End key ----@field pageup integer # Page up key ----@field pagedown integer # Page down key ----@field insert integer # Insert key ----@field backspace integer # Backspace key ----@field tab integer # Tab key ----@field clear integer # Clear key ----@field return integer # Return key ----@field delete integer # Delete key ----@field f1 integer # The 1st function key ----@field f2 integer # The 2nd function key ----@field f3 integer # The 3rd function key ----@field f4 integer # The 4th function key ----@field f5 integer # The 5th function key ----@field f6 integer # The 6th function key ----@field f7 integer # The 7th function key ----@field f8 integer # The 8th function key ----@field f9 integer # The 9th function key ----@field f10 integer # The 10th function key ----@field f11 integer # The 11th function key ----@field f12 integer # The 12th function key ----@field f13 integer # The 13th function key ----@field f14 integer # The 14th function key ----@field f15 integer # The 15th function key ----@field numlock integer # Num-lock key ----@field capslock integer # Caps-lock key ----@field scrollock integer # Scroll-lock key ----@field rshift integer # Right shift key ----@field lshift integer # Left shift key ----@field rctrl integer # Right control key ----@field lctrl integer # Left control key ----@field ralt integer # Right alt key ----@field lalt integer # Left alt key ----@field rmeta integer # Right meta key ----@field lmeta integer # Left meta key ----@field lsuper integer # Left super key ----@field rsuper integer # Right super key ----@field mode integer # Mode key ----@field compose integer # Compose key ----@field pause integer # Pause key ----@field escape integer # Escape key ----@field help integer # Help key ----@field print integer # Print key ----@field sysreq integer # System request key ----@field break integer # Break key ----@field menu integer # Menu key ----@field power integer # Power key ----@field euro integer # Euro (€) key ----@field undo integer # Undo key ----@field www integer # WWW key ----@field mail integer # Mail key ----@field calculator integer # Calculator key ----@field appsearch integer # Application search key ----@field apphome integer # Application home key ----@field appback integer # Application back key ----@field appforward integer # Application forward key ----@field apprefresh integer # Application refresh key ----@field appbookmarks integer # Application bookmarks key +--- +---The A key +--- +---@field ["a"] integer +--- +---The B key +--- +---@field ["b"] integer +--- +---The C key +--- +---@field ["c"] integer +--- +---The D key +--- +---@field ["d"] integer +--- +---The E key +--- +---@field ["e"] integer +--- +---The F key +--- +---@field ["f"] integer +--- +---The G key +--- +---@field ["g"] integer +--- +---The H key +--- +---@field ["h"] integer +--- +---The I key +--- +---@field ["i"] integer +--- +---The J key +--- +---@field ["j"] integer +--- +---The K key +--- +---@field ["k"] integer +--- +---The L key +--- +---@field ["l"] integer +--- +---The M key +--- +---@field ["m"] integer +--- +---The N key +--- +---@field ["n"] integer +--- +---The O key +--- +---@field ["o"] integer +--- +---The P key +--- +---@field ["p"] integer +--- +---The Q key +--- +---@field ["q"] integer +--- +---The R key +--- +---@field ["r"] integer +--- +---The S key +--- +---@field ["s"] integer +--- +---The T key +--- +---@field ["t"] integer +--- +---The U key +--- +---@field ["u"] integer +--- +---The V key +--- +---@field ["v"] integer +--- +---The W key +--- +---@field ["w"] integer +--- +---The X key +--- +---@field ["x"] integer +--- +---The Y key +--- +---@field ["y"] integer +--- +---The Z key +--- +---@field ["z"] integer +--- +---The zero key +--- +---@field ["0"] integer +--- +---The one key +--- +---@field ["1"] integer +--- +---The two key +--- +---@field ["2"] integer +--- +---The three key +--- +---@field ["3"] integer +--- +---The four key +--- +---@field ["4"] integer +--- +---The five key +--- +---@field ["5"] integer +--- +---The six key +--- +---@field ["6"] integer +--- +---The seven key +--- +---@field ["7"] integer +--- +---The eight key +--- +---@field ["8"] integer +--- +---The nine key +--- +---@field ["9"] integer +--- +---Space key +--- +---@field space integer +--- +---Exclamation mark key +--- +---@field ["!"] integer +--- +---Double quote key +--- +---@field ["\""] integer +--- +---Hash key +--- +---@field ["#"] integer +--- +---Dollar key +--- +---@field ["$"] integer +--- +---Ampersand key +--- +---@field ["&"] integer +--- +---Single quote key +--- +---@field ["'"] integer +--- +---Left parenthesis key +--- +---@field ["("] integer +--- +---Right parenthesis key +--- +---@field [")"] integer +--- +---Asterisk key +--- +---@field ["*"] integer +--- +---Plus key +--- +---@field ["+"] integer +--- +---Comma key +--- +---@field [","] integer +--- +---Hyphen-minus key +--- +---@field ["-"] integer +--- +---Full stop key +--- +---@field ["."] integer +--- +---Slash key +--- +---@field ["/"] integer +--- +---Colon key +--- +---@field [":"] integer +--- +---Semicolon key +--- +---@field [";"] integer +--- +---Less-than key +--- +---@field ["<"] integer +--- +---Equal key +--- +---@field ["="] integer +--- +---Greater-than key +--- +---@field [">"] integer +--- +---Question mark key +--- +---@field ["?"] integer +--- +---At sign key +--- +---@field ["@"] integer +--- +---Left square bracket key +--- +---@field ["["] integer +--- +---Backslash key +--- +---@field ["\\"] integer +--- +---Right square bracket key +--- +---@field ["]"] integer +--- +---Caret key +--- +---@field ["^"] integer +--- +---Underscore key +--- +---@field ["_"] integer +--- +---Grave accent key +--- +---@field ["`"] integer +--- +---The numpad zero key +--- +---@field kp0 integer +--- +---The numpad one key +--- +---@field kp1 integer +--- +---The numpad two key +--- +---@field kp2 integer +--- +---The numpad three key +--- +---@field kp3 integer +--- +---The numpad four key +--- +---@field kp4 integer +--- +---The numpad five key +--- +---@field kp5 integer +--- +---The numpad six key +--- +---@field kp6 integer +--- +---The numpad seven key +--- +---@field kp7 integer +--- +---The numpad eight key +--- +---@field kp8 integer +--- +---The numpad nine key +--- +---@field kp9 integer +--- +---The numpad decimal point key +--- +---@field ["kp."] integer +--- +---The numpad division key +--- +---@field ["kp/"] integer +--- +---The numpad multiplication key +--- +---@field ["kp*"] integer +--- +---The numpad substraction key +--- +---@field ["kp-"] integer +--- +---The numpad addition key +--- +---@field ["kp+"] integer +--- +---The numpad enter key +--- +---@field kpenter integer +--- +---The numpad equals key +--- +---@field ["kp="] integer +--- +---Up cursor key +--- +---@field up integer +--- +---Down cursor key +--- +---@field down integer +--- +---Right cursor key +--- +---@field right integer +--- +---Left cursor key +--- +---@field left integer +--- +---Home key +--- +---@field home integer +--- +---End key +--- +---@field end integer +--- +---Page up key +--- +---@field pageup integer +--- +---Page down key +--- +---@field pagedown integer +--- +---Insert key +--- +---@field insert integer +--- +---Backspace key +--- +---@field backspace integer +--- +---Tab key +--- +---@field tab integer +--- +---Clear key +--- +---@field clear integer +--- +---Return key +--- +---@field return integer +--- +---Delete key +--- +---@field delete integer +--- +---The 1st function key +--- +---@field f1 integer +--- +---The 2nd function key +--- +---@field f2 integer +--- +---The 3rd function key +--- +---@field f3 integer +--- +---The 4th function key +--- +---@field f4 integer +--- +---The 5th function key +--- +---@field f5 integer +--- +---The 6th function key +--- +---@field f6 integer +--- +---The 7th function key +--- +---@field f7 integer +--- +---The 8th function key +--- +---@field f8 integer +--- +---The 9th function key +--- +---@field f9 integer +--- +---The 10th function key +--- +---@field f10 integer +--- +---The 11th function key +--- +---@field f11 integer +--- +---The 12th function key +--- +---@field f12 integer +--- +---The 13th function key +--- +---@field f13 integer +--- +---The 14th function key +--- +---@field f14 integer +--- +---The 15th function key +--- +---@field f15 integer +--- +---Num-lock key +--- +---@field numlock integer +--- +---Caps-lock key +--- +---@field capslock integer +--- +---Scroll-lock key +--- +---@field scrollock integer +--- +---Right shift key +--- +---@field rshift integer +--- +---Left shift key +--- +---@field lshift integer +--- +---Right control key +--- +---@field rctrl integer +--- +---Left control key +--- +---@field lctrl integer +--- +---Right alt key +--- +---@field ralt integer +--- +---Left alt key +--- +---@field lalt integer +--- +---Right meta key +--- +---@field rmeta integer +--- +---Left meta key +--- +---@field lmeta integer +--- +---Left super key +--- +---@field lsuper integer +--- +---Right super key +--- +---@field rsuper integer +--- +---Mode key +--- +---@field mode integer +--- +---Compose key +--- +---@field compose integer +--- +---Pause key +--- +---@field pause integer +--- +---Escape key +--- +---@field escape integer +--- +---Help key +--- +---@field help integer +--- +---Print key +--- +---@field print integer +--- +---System request key +--- +---@field sysreq integer +--- +---Break key +--- +---@field break integer +--- +---Menu key +--- +---@field menu integer +--- +---Power key +--- +---@field power integer +--- +---Euro (€) key +--- +---@field euro integer +--- +---Undo key +--- +---@field undo integer +--- +---WWW key +--- +---@field www integer +--- +---Mail key +--- +---@field mail integer +--- +---Calculator key +--- +---@field calculator integer +--- +---Application search key +--- +---@field appsearch integer +--- +---Application home key +--- +---@field apphome integer +--- +---Application back key +--- +---@field appback integer +--- +---Application forward key +--- +---@field appforward integer +--- +---Application refresh key +--- +---@field apprefresh integer +--- +---Application bookmarks key +--- +---@field appbookmarks integer +--- +---Keyboard scancodes. +--- +---Scancodes are keyboard layout-independent, so the scancode "w" will be generated if the key in the same place as the "w" key on an American QWERTY keyboard is pressed, no matter what the key is labelled or what the user's operating system settings are. +--- +---Using scancodes, rather than keycodes, is useful because keyboards with layouts differing from the US/UK layout(s) might have keys that generate 'unknown' keycodes, but the scancodes will still be detected. This however would necessitate having a list for each keyboard layout one would choose to support. +--- +---One could use textinput or textedited instead, but those only give back the end result of keys used, i.e. you can't get modifiers on their own from it, only the final symbols that were generated. +--- ---@class love.Scancode ----@field a integer # The 'A' key on an American layout. ----@field b integer # The 'B' key on an American layout. ----@field c integer # The 'C' key on an American layout. ----@field d integer # The 'D' key on an American layout. ----@field e integer # The 'E' key on an American layout. ----@field f integer # The 'F' key on an American layout. ----@field g integer # The 'G' key on an American layout. ----@field h integer # The 'H' key on an American layout. ----@field i integer # The 'I' key on an American layout. ----@field j integer # The 'J' key on an American layout. ----@field k integer # The 'K' key on an American layout. ----@field l integer # The 'L' key on an American layout. ----@field m integer # The 'M' key on an American layout. ----@field n integer # The 'N' key on an American layout. ----@field o integer # The 'O' key on an American layout. ----@field p integer # The 'P' key on an American layout. ----@field q integer # The 'Q' key on an American layout. ----@field r integer # The 'R' key on an American layout. ----@field s integer # The 'S' key on an American layout. ----@field t integer # The 'T' key on an American layout. ----@field u integer # The 'U' key on an American layout. ----@field v integer # The 'V' key on an American layout. ----@field w integer # The 'W' key on an American layout. ----@field x integer # The 'X' key on an American layout. ----@field y integer # The 'Y' key on an American layout. ----@field z integer # The 'Z' key on an American layout. ----@field 1 integer # The '1' key on an American layout. ----@field 2 integer # The '2' key on an American layout. ----@field 3 integer # The '3' key on an American layout. ----@field 4 integer # The '4' key on an American layout. ----@field 5 integer # The '5' key on an American layout. ----@field 6 integer # The '6' key on an American layout. ----@field 7 integer # The '7' key on an American layout. ----@field 8 integer # The '8' key on an American layout. ----@field 9 integer # The '9' key on an American layout. ----@field 0 integer # The '0' key on an American layout. ----@field return integer # The 'return' / 'enter' key on an American layout. ----@field escape integer # The 'escape' key on an American layout. ----@field backspace integer # The 'backspace' key on an American layout. ----@field tab integer # The 'tab' key on an American layout. ----@field space integer # The spacebar on an American layout. ----@field - integer # The minus key on an American layout. ----@field = integer # The equals key on an American layout. ----@field [ integer # The left-bracket key on an American layout. ----@field ] integer # The right-bracket key on an American layout. ----@field \ integer # The backslash key on an American layout. ----@field nonus# integer # The non-U.S. hash scancode. ----@field ; integer # The semicolon key on an American layout. ----@field ' integer # The apostrophe key on an American layout. ----@field ` integer # The back-tick / grave key on an American layout. ----@field , integer # The comma key on an American layout. ----@field . integer # The period key on an American layout. ----@field / integer # The forward-slash key on an American layout. ----@field capslock integer # The capslock key on an American layout. ----@field f1 integer # The F1 key on an American layout. ----@field f2 integer # The F2 key on an American layout. ----@field f3 integer # The F3 key on an American layout. ----@field f4 integer # The F4 key on an American layout. ----@field f5 integer # The F5 key on an American layout. ----@field f6 integer # The F6 key on an American layout. ----@field f7 integer # The F7 key on an American layout. ----@field f8 integer # The F8 key on an American layout. ----@field f9 integer # The F9 key on an American layout. ----@field f10 integer # The F10 key on an American layout. ----@field f11 integer # The F11 key on an American layout. ----@field f12 integer # The F12 key on an American layout. ----@field f13 integer # The F13 key on an American layout. ----@field f14 integer # The F14 key on an American layout. ----@field f15 integer # The F15 key on an American layout. ----@field f16 integer # The F16 key on an American layout. ----@field f17 integer # The F17 key on an American layout. ----@field f18 integer # The F18 key on an American layout. ----@field f19 integer # The F19 key on an American layout. ----@field f20 integer # The F20 key on an American layout. ----@field f21 integer # The F21 key on an American layout. ----@field f22 integer # The F22 key on an American layout. ----@field f23 integer # The F23 key on an American layout. ----@field f24 integer # The F24 key on an American layout. ----@field lctrl integer # The left control key on an American layout. ----@field lshift integer # The left shift key on an American layout. ----@field lalt integer # The left alt / option key on an American layout. ----@field lgui integer # The left GUI (command / windows / super) key on an American layout. ----@field rctrl integer # The right control key on an American layout. ----@field rshift integer # The right shift key on an American layout. ----@field ralt integer # The right alt / option key on an American layout. ----@field rgui integer # The right GUI (command / windows / super) key on an American layout. ----@field printscreen integer # The printscreen key on an American layout. ----@field scrolllock integer # The scroll-lock key on an American layout. ----@field pause integer # The pause key on an American layout. ----@field insert integer # The insert key on an American layout. ----@field home integer # The home key on an American layout. ----@field numlock integer # The numlock / clear key on an American layout. ----@field pageup integer # The page-up key on an American layout. ----@field delete integer # The forward-delete key on an American layout. ----@field end integer # The end key on an American layout. ----@field pagedown integer # The page-down key on an American layout. ----@field right integer # The right-arrow key on an American layout. ----@field left integer # The left-arrow key on an American layout. ----@field down integer # The down-arrow key on an American layout. ----@field up integer # The up-arrow key on an American layout. ----@field nonusbackslash integer # The non-U.S. backslash scancode. ----@field application integer # The application key on an American layout. Windows contextual menu, compose key. ----@field execute integer # The 'execute' key on an American layout. ----@field help integer # The 'help' key on an American layout. ----@field menu integer # The 'menu' key on an American layout. ----@field select integer # The 'select' key on an American layout. ----@field stop integer # The 'stop' key on an American layout. ----@field again integer # The 'again' key on an American layout. ----@field undo integer # The 'undo' key on an American layout. ----@field cut integer # The 'cut' key on an American layout. ----@field copy integer # The 'copy' key on an American layout. ----@field paste integer # The 'paste' key on an American layout. ----@field find integer # The 'find' key on an American layout. ----@field kp/ integer # The keypad forward-slash key on an American layout. ----@field kp* integer # The keypad '*' key on an American layout. ----@field kp- integer # The keypad minus key on an American layout. ----@field kp+ integer # The keypad plus key on an American layout. ----@field kp= integer # The keypad equals key on an American layout. ----@field kpenter integer # The keypad enter key on an American layout. ----@field kp1 integer # The keypad '1' key on an American layout. ----@field kp2 integer # The keypad '2' key on an American layout. ----@field kp3 integer # The keypad '3' key on an American layout. ----@field kp4 integer # The keypad '4' key on an American layout. ----@field kp5 integer # The keypad '5' key on an American layout. ----@field kp6 integer # The keypad '6' key on an American layout. ----@field kp7 integer # The keypad '7' key on an American layout. ----@field kp8 integer # The keypad '8' key on an American layout. ----@field kp9 integer # The keypad '9' key on an American layout. ----@field kp0 integer # The keypad '0' key on an American layout. ----@field kp. integer # The keypad period key on an American layout. ----@field international1 integer # The 1st international key on an American layout. Used on Asian keyboards. ----@field international2 integer # The 2nd international key on an American layout. ----@field international3 integer # The 3rd international key on an American layout. Yen. ----@field international4 integer # The 4th international key on an American layout. ----@field international5 integer # The 5th international key on an American layout. ----@field international6 integer # The 6th international key on an American layout. ----@field international7 integer # The 7th international key on an American layout. ----@field international8 integer # The 8th international key on an American layout. ----@field international9 integer # The 9th international key on an American layout. ----@field lang1 integer # Hangul/English toggle scancode. ----@field lang2 integer # Hanja conversion scancode. ----@field lang3 integer # Katakana scancode. ----@field lang4 integer # Hiragana scancode. ----@field lang5 integer # Zenkaku/Hankaku scancode. ----@field mute integer # The mute key on an American layout. ----@field volumeup integer # The volume up key on an American layout. ----@field volumedown integer # The volume down key on an American layout. ----@field audionext integer # The audio next track key on an American layout. ----@field audioprev integer # The audio previous track key on an American layout. ----@field audiostop integer # The audio stop key on an American layout. ----@field audioplay integer # The audio play key on an American layout. ----@field audiomute integer # The audio mute key on an American layout. ----@field mediaselect integer # The media select key on an American layout. ----@field www integer # The 'WWW' key on an American layout. ----@field mail integer # The Mail key on an American layout. ----@field calculator integer # The calculator key on an American layout. ----@field computer integer # The 'computer' key on an American layout. ----@field acsearch integer # The AC Search key on an American layout. ----@field achome integer # The AC Home key on an American layout. ----@field acback integer # The AC Back key on an American layout. ----@field acforward integer # The AC Forward key on an American layout. ----@field acstop integer # Th AC Stop key on an American layout. ----@field acrefresh integer # The AC Refresh key on an American layout. ----@field acbookmarks integer # The AC Bookmarks key on an American layout. ----@field power integer # The system power scancode. ----@field brightnessdown integer # The brightness-down scancode. ----@field brightnessup integer # The brightness-up scancode. ----@field displayswitch integer # The display switch scancode. ----@field kbdillumtoggle integer # The keyboard illumination toggle scancode. ----@field kbdillumdown integer # The keyboard illumination down scancode. ----@field kbdillumup integer # The keyboard illumination up scancode. ----@field eject integer # The eject scancode. ----@field sleep integer # The system sleep scancode. ----@field alterase integer # The alt-erase key on an American layout. ----@field sysreq integer # The sysreq key on an American layout. ----@field cancel integer # The 'cancel' key on an American layout. ----@field clear integer # The 'clear' key on an American layout. ----@field prior integer # The 'prior' key on an American layout. ----@field return2 integer # The 'return2' key on an American layout. ----@field separator integer # The 'separator' key on an American layout. ----@field out integer # The 'out' key on an American layout. ----@field oper integer # The 'oper' key on an American layout. ----@field clearagain integer # The 'clearagain' key on an American layout. ----@field crsel integer # The 'crsel' key on an American layout. ----@field exsel integer # The 'exsel' key on an American layout. ----@field kp00 integer # The keypad 00 key on an American layout. ----@field kp000 integer # The keypad 000 key on an American layout. ----@field thsousandsseparator integer # The thousands-separator key on an American layout. ----@field decimalseparator integer # The decimal separator key on an American layout. ----@field currencyunit integer # The currency unit key on an American layout. ----@field currencysubunit integer # The currency sub-unit key on an American layout. ----@field app1 integer # The 'app1' scancode. ----@field app2 integer # The 'app2' scancode. ----@field unknown integer # An unknown key. +--- +---The 'A' key on an American layout. +--- +---@field ["a"] integer +--- +---The 'B' key on an American layout. +--- +---@field ["b"] integer +--- +---The 'C' key on an American layout. +--- +---@field ["c"] integer +--- +---The 'D' key on an American layout. +--- +---@field ["d"] integer +--- +---The 'E' key on an American layout. +--- +---@field ["e"] integer +--- +---The 'F' key on an American layout. +--- +---@field ["f"] integer +--- +---The 'G' key on an American layout. +--- +---@field ["g"] integer +--- +---The 'H' key on an American layout. +--- +---@field ["h"] integer +--- +---The 'I' key on an American layout. +--- +---@field ["i"] integer +--- +---The 'J' key on an American layout. +--- +---@field ["j"] integer +--- +---The 'K' key on an American layout. +--- +---@field ["k"] integer +--- +---The 'L' key on an American layout. +--- +---@field ["l"] integer +--- +---The 'M' key on an American layout. +--- +---@field ["m"] integer +--- +---The 'N' key on an American layout. +--- +---@field ["n"] integer +--- +---The 'O' key on an American layout. +--- +---@field ["o"] integer +--- +---The 'P' key on an American layout. +--- +---@field ["p"] integer +--- +---The 'Q' key on an American layout. +--- +---@field ["q"] integer +--- +---The 'R' key on an American layout. +--- +---@field ["r"] integer +--- +---The 'S' key on an American layout. +--- +---@field ["s"] integer +--- +---The 'T' key on an American layout. +--- +---@field ["t"] integer +--- +---The 'U' key on an American layout. +--- +---@field ["u"] integer +--- +---The 'V' key on an American layout. +--- +---@field ["v"] integer +--- +---The 'W' key on an American layout. +--- +---@field ["w"] integer +--- +---The 'X' key on an American layout. +--- +---@field ["x"] integer +--- +---The 'Y' key on an American layout. +--- +---@field ["y"] integer +--- +---The 'Z' key on an American layout. +--- +---@field ["z"] integer +--- +---The '1' key on an American layout. +--- +---@field ["1"] integer +--- +---The '2' key on an American layout. +--- +---@field ["2"] integer +--- +---The '3' key on an American layout. +--- +---@field ["3"] integer +--- +---The '4' key on an American layout. +--- +---@field ["4"] integer +--- +---The '5' key on an American layout. +--- +---@field ["5"] integer +--- +---The '6' key on an American layout. +--- +---@field ["6"] integer +--- +---The '7' key on an American layout. +--- +---@field ["7"] integer +--- +---The '8' key on an American layout. +--- +---@field ["8"] integer +--- +---The '9' key on an American layout. +--- +---@field ["9"] integer +--- +---The '0' key on an American layout. +--- +---@field ["0"] integer +--- +---The 'return' / 'enter' key on an American layout. +--- +---@field return integer +--- +---The 'escape' key on an American layout. +--- +---@field escape integer +--- +---The 'backspace' key on an American layout. +--- +---@field backspace integer +--- +---The 'tab' key on an American layout. +--- +---@field tab integer +--- +---The spacebar on an American layout. +--- +---@field space integer +--- +---The minus key on an American layout. +--- +---@field ["-"] integer +--- +---The equals key on an American layout. +--- +---@field ["="] integer +--- +---The left-bracket key on an American layout. +--- +---@field ["["] integer +--- +---The right-bracket key on an American layout. +--- +---@field ["]"] integer +--- +---The backslash key on an American layout. +--- +---@field ["\\"] integer +--- +---The non-U.S. hash scancode. +--- +---@field ["nonus#"] integer +--- +---The semicolon key on an American layout. +--- +---@field [";"] integer +--- +---The apostrophe key on an American layout. +--- +---@field ["'"] integer +--- +---The back-tick / grave key on an American layout. +--- +---@field ["`"] integer +--- +---The comma key on an American layout. +--- +---@field [","] integer +--- +---The period key on an American layout. +--- +---@field ["."] integer +--- +---The forward-slash key on an American layout. +--- +---@field ["/"] integer +--- +---The capslock key on an American layout. +--- +---@field capslock integer +--- +---The F1 key on an American layout. +--- +---@field f1 integer +--- +---The F2 key on an American layout. +--- +---@field f2 integer +--- +---The F3 key on an American layout. +--- +---@field f3 integer +--- +---The F4 key on an American layout. +--- +---@field f4 integer +--- +---The F5 key on an American layout. +--- +---@field f5 integer +--- +---The F6 key on an American layout. +--- +---@field f6 integer +--- +---The F7 key on an American layout. +--- +---@field f7 integer +--- +---The F8 key on an American layout. +--- +---@field f8 integer +--- +---The F9 key on an American layout. +--- +---@field f9 integer +--- +---The F10 key on an American layout. +--- +---@field f10 integer +--- +---The F11 key on an American layout. +--- +---@field f11 integer +--- +---The F12 key on an American layout. +--- +---@field f12 integer +--- +---The F13 key on an American layout. +--- +---@field f13 integer +--- +---The F14 key on an American layout. +--- +---@field f14 integer +--- +---The F15 key on an American layout. +--- +---@field f15 integer +--- +---The F16 key on an American layout. +--- +---@field f16 integer +--- +---The F17 key on an American layout. +--- +---@field f17 integer +--- +---The F18 key on an American layout. +--- +---@field f18 integer +--- +---The F19 key on an American layout. +--- +---@field f19 integer +--- +---The F20 key on an American layout. +--- +---@field f20 integer +--- +---The F21 key on an American layout. +--- +---@field f21 integer +--- +---The F22 key on an American layout. +--- +---@field f22 integer +--- +---The F23 key on an American layout. +--- +---@field f23 integer +--- +---The F24 key on an American layout. +--- +---@field f24 integer +--- +---The left control key on an American layout. +--- +---@field lctrl integer +--- +---The left shift key on an American layout. +--- +---@field lshift integer +--- +---The left alt / option key on an American layout. +--- +---@field lalt integer +--- +---The left GUI (command / windows / super) key on an American layout. +--- +---@field lgui integer +--- +---The right control key on an American layout. +--- +---@field rctrl integer +--- +---The right shift key on an American layout. +--- +---@field rshift integer +--- +---The right alt / option key on an American layout. +--- +---@field ralt integer +--- +---The right GUI (command / windows / super) key on an American layout. +--- +---@field rgui integer +--- +---The printscreen key on an American layout. +--- +---@field printscreen integer +--- +---The scroll-lock key on an American layout. +--- +---@field scrolllock integer +--- +---The pause key on an American layout. +--- +---@field pause integer +--- +---The insert key on an American layout. +--- +---@field insert integer +--- +---The home key on an American layout. +--- +---@field home integer +--- +---The numlock / clear key on an American layout. +--- +---@field numlock integer +--- +---The page-up key on an American layout. +--- +---@field pageup integer +--- +---The forward-delete key on an American layout. +--- +---@field delete integer +--- +---The end key on an American layout. +--- +---@field end integer +--- +---The page-down key on an American layout. +--- +---@field pagedown integer +--- +---The right-arrow key on an American layout. +--- +---@field right integer +--- +---The left-arrow key on an American layout. +--- +---@field left integer +--- +---The down-arrow key on an American layout. +--- +---@field down integer +--- +---The up-arrow key on an American layout. +--- +---@field up integer +--- +---The non-U.S. backslash scancode. +--- +---@field nonusbackslash integer +--- +---The application key on an American layout. Windows contextual menu, compose key. +--- +---@field application integer +--- +---The 'execute' key on an American layout. +--- +---@field execute integer +--- +---The 'help' key on an American layout. +--- +---@field help integer +--- +---The 'menu' key on an American layout. +--- +---@field menu integer +--- +---The 'select' key on an American layout. +--- +---@field select integer +--- +---The 'stop' key on an American layout. +--- +---@field stop integer +--- +---The 'again' key on an American layout. +--- +---@field again integer +--- +---The 'undo' key on an American layout. +--- +---@field undo integer +--- +---The 'cut' key on an American layout. +--- +---@field cut integer +--- +---The 'copy' key on an American layout. +--- +---@field copy integer +--- +---The 'paste' key on an American layout. +--- +---@field paste integer +--- +---The 'find' key on an American layout. +--- +---@field find integer +--- +---The keypad forward-slash key on an American layout. +--- +---@field ["kp/"] integer +--- +---The keypad '*' key on an American layout. +--- +---@field ["kp*"] integer +--- +---The keypad minus key on an American layout. +--- +---@field ["kp-"] integer +--- +---The keypad plus key on an American layout. +--- +---@field ["kp+"] integer +--- +---The keypad equals key on an American layout. +--- +---@field ["kp="] integer +--- +---The keypad enter key on an American layout. +--- +---@field kpenter integer +--- +---The keypad '1' key on an American layout. +--- +---@field kp1 integer +--- +---The keypad '2' key on an American layout. +--- +---@field kp2 integer +--- +---The keypad '3' key on an American layout. +--- +---@field kp3 integer +--- +---The keypad '4' key on an American layout. +--- +---@field kp4 integer +--- +---The keypad '5' key on an American layout. +--- +---@field kp5 integer +--- +---The keypad '6' key on an American layout. +--- +---@field kp6 integer +--- +---The keypad '7' key on an American layout. +--- +---@field kp7 integer +--- +---The keypad '8' key on an American layout. +--- +---@field kp8 integer +--- +---The keypad '9' key on an American layout. +--- +---@field kp9 integer +--- +---The keypad '0' key on an American layout. +--- +---@field kp0 integer +--- +---The keypad period key on an American layout. +--- +---@field ["kp."] integer +--- +---The 1st international key on an American layout. Used on Asian keyboards. +--- +---@field international1 integer +--- +---The 2nd international key on an American layout. +--- +---@field international2 integer +--- +---The 3rd international key on an American layout. Yen. +--- +---@field international3 integer +--- +---The 4th international key on an American layout. +--- +---@field international4 integer +--- +---The 5th international key on an American layout. +--- +---@field international5 integer +--- +---The 6th international key on an American layout. +--- +---@field international6 integer +--- +---The 7th international key on an American layout. +--- +---@field international7 integer +--- +---The 8th international key on an American layout. +--- +---@field international8 integer +--- +---The 9th international key on an American layout. +--- +---@field international9 integer +--- +---Hangul/English toggle scancode. +--- +---@field lang1 integer +--- +---Hanja conversion scancode. +--- +---@field lang2 integer +--- +---Katakana scancode. +--- +---@field lang3 integer +--- +---Hiragana scancode. +--- +---@field lang4 integer +--- +---Zenkaku/Hankaku scancode. +--- +---@field lang5 integer +--- +---The mute key on an American layout. +--- +---@field mute integer +--- +---The volume up key on an American layout. +--- +---@field volumeup integer +--- +---The volume down key on an American layout. +--- +---@field volumedown integer +--- +---The audio next track key on an American layout. +--- +---@field audionext integer +--- +---The audio previous track key on an American layout. +--- +---@field audioprev integer +--- +---The audio stop key on an American layout. +--- +---@field audiostop integer +--- +---The audio play key on an American layout. +--- +---@field audioplay integer +--- +---The audio mute key on an American layout. +--- +---@field audiomute integer +--- +---The media select key on an American layout. +--- +---@field mediaselect integer +--- +---The 'WWW' key on an American layout. +--- +---@field www integer +--- +---The Mail key on an American layout. +--- +---@field mail integer +--- +---The calculator key on an American layout. +--- +---@field calculator integer +--- +---The 'computer' key on an American layout. +--- +---@field computer integer +--- +---The AC Search key on an American layout. +--- +---@field acsearch integer +--- +---The AC Home key on an American layout. +--- +---@field achome integer +--- +---The AC Back key on an American layout. +--- +---@field acback integer +--- +---The AC Forward key on an American layout. +--- +---@field acforward integer +--- +---Th AC Stop key on an American layout. +--- +---@field acstop integer +--- +---The AC Refresh key on an American layout. +--- +---@field acrefresh integer +--- +---The AC Bookmarks key on an American layout. +--- +---@field acbookmarks integer +--- +---The system power scancode. +--- +---@field power integer +--- +---The brightness-down scancode. +--- +---@field brightnessdown integer +--- +---The brightness-up scancode. +--- +---@field brightnessup integer +--- +---The display switch scancode. +--- +---@field displayswitch integer +--- +---The keyboard illumination toggle scancode. +--- +---@field kbdillumtoggle integer +--- +---The keyboard illumination down scancode. +--- +---@field kbdillumdown integer +--- +---The keyboard illumination up scancode. +--- +---@field kbdillumup integer +--- +---The eject scancode. +--- +---@field eject integer +--- +---The system sleep scancode. +--- +---@field sleep integer +--- +---The alt-erase key on an American layout. +--- +---@field alterase integer +--- +---The sysreq key on an American layout. +--- +---@field sysreq integer +--- +---The 'cancel' key on an American layout. +--- +---@field cancel integer +--- +---The 'clear' key on an American layout. +--- +---@field clear integer +--- +---The 'prior' key on an American layout. +--- +---@field prior integer +--- +---The 'return2' key on an American layout. +--- +---@field return2 integer +--- +---The 'separator' key on an American layout. +--- +---@field separator integer +--- +---The 'out' key on an American layout. +--- +---@field out integer +--- +---The 'oper' key on an American layout. +--- +---@field oper integer +--- +---The 'clearagain' key on an American layout. +--- +---@field clearagain integer +--- +---The 'crsel' key on an American layout. +--- +---@field crsel integer +--- +---The 'exsel' key on an American layout. +--- +---@field exsel integer +--- +---The keypad 00 key on an American layout. +--- +---@field kp00 integer +--- +---The keypad 000 key on an American layout. +--- +---@field kp000 integer +--- +---The thousands-separator key on an American layout. +--- +---@field thsousandsseparator integer +--- +---The decimal separator key on an American layout. +--- +---@field decimalseparator integer +--- +---The currency unit key on an American layout. +--- +---@field currencyunit integer +--- +---The currency sub-unit key on an American layout. +--- +---@field currencysubunit integer +--- +---The 'app1' scancode. +--- +---@field app1 integer +--- +---The 'app2' scancode. +--- +---@field app2 integer +--- +---An unknown key. +--- +---@field unknown integer diff --git a/meta/3rd/love2d/library/love.lua b/meta/3rd/love2d/library/love.lua index 081175f8..2a4aa99d 100644 --- a/meta/3rd/love2d/library/love.lua +++ b/meta/3rd/love2d/library/love.lua @@ -1,5 +1,6 @@ ---@meta +-- version: 11.3 ---@class love love = {} @@ -28,6 +29,9 @@ function love.hasDeprecationOutput() end ---@param enable boolean # Whether to enable or disable deprecation output. function love.setDeprecationOutput(enable) end +--- +---The superclass of all data. +--- ---@class love.Data: love.Object local Data = {} @@ -48,7 +52,7 @@ function Data:getFFIPointer() end --- ---Gets a pointer to the Data. Can be used with libraries such as LuaJIT's FFI. --- ----@return love.light|userdata pointer # A raw pointer to the Data. +---@return lightuserdata pointer # A raw pointer to the Data. function Data:getPointer() end --- @@ -63,6 +67,9 @@ function Data:getSize() end ---@return string data # The raw data. function Data:getString() end +--- +---The superclass of all LÖVE types. +--- ---@class love.Object local Object = {} @@ -86,74 +93,186 @@ function Object:type() end ---@param name string # The name of the type to check for. function Object:typeOf(name) end ----@type love.conf +--- +---If a file called conf.lua is present in your game folder (or .love file), it is run before the LÖVE modules are loaded. You can use this file to overwrite the love.conf function, which is later called by the LÖVE 'boot' script. Using the love.conf function, you can set some configuration options, and change things like the default size of the window, which modules are loaded, and other stuff. +--- +---@alias love.conf fun(t: table) ----@type love.directorydropped +--- +---Callback function triggered when a directory is dragged and dropped onto the window. +--- +---@alias love.directorydropped fun(path: string) ----@type love.displayrotated +--- +---Called when the device display orientation changed, for example, user rotated their phone 180 degrees. +--- +---@alias love.displayrotated fun(index: number, orientation: love.DisplayOrientation) ----@type love.draw +--- +---Callback function used to draw on the screen every frame. +--- +---@alias love.draw fun() ----@type love.errorhandler +--- +---The error handler, used to display error messages. +--- +---@alias love.errorhandler fun(msg: string) ----@type love.filedropped +--- +---Callback function triggered when a file is dragged and dropped onto the window. +--- +---@alias love.filedropped fun(file: love.DroppedFile) ----@type love.focus +--- +---Callback function triggered when window receives or loses focus. +--- +---@alias love.focus fun(focus: boolean) ----@type love.gamepadaxis +--- +---Called when a Joystick's virtual gamepad axis is moved. +--- +---@alias love.gamepadaxis fun(joystick: love.Joystick, axis: love.GamepadAxis, value: number) ----@type love.gamepadpressed +--- +---Called when a Joystick's virtual gamepad button is pressed. +--- +---@alias love.gamepadpressed fun(joystick: love.Joystick, button: love.GamepadButton) ----@type love.gamepadreleased +--- +---Called when a Joystick's virtual gamepad button is released. +--- +---@alias love.gamepadreleased fun(joystick: love.Joystick, button: love.GamepadButton) ----@type love.joystickadded +--- +---Called when a Joystick is connected. +--- +---@alias love.joystickadded fun(joystick: love.Joystick) ----@type love.joystickaxis +--- +---Called when a joystick axis moves. +--- +---@alias love.joystickaxis fun(joystick: love.Joystick, axis: number, value: number) ----@type love.joystickhat +--- +---Called when a joystick hat direction changes. +--- +---@alias love.joystickhat fun(joystick: love.Joystick, hat: number, direction: love.JoystickHat) ----@type love.joystickpressed +--- +---Called when a joystick button is pressed. +--- +---@alias love.joystickpressed fun(joystick: love.Joystick, button: number) ----@type love.joystickreleased +--- +---Called when a joystick button is released. +--- +---@alias love.joystickreleased fun(joystick: love.Joystick, button: number) ----@type love.joystickremoved +--- +---Called when a Joystick is disconnected. +--- +---@alias love.joystickremoved fun(joystick: love.Joystick) ----@type love.keypressed +--- +---Callback function triggered when a key is pressed. +--- +---@alias love.keypressed fun(key: love.KeyConstant, scancode: love.Scancode, isrepeat: boolean)|fun(key: love.KeyConstant, isrepeat: boolean) ----@type love.keyreleased +--- +---Callback function triggered when a keyboard key is released. +--- +---@alias love.keyreleased fun(key: love.KeyConstant, scancode: love.Scancode) ----@type love.load +--- +---This function is called exactly once at the beginning of the game. +--- +---@alias love.load fun(arg: table, unfilteredArg: table) ----@type love.lowmemory +--- +---Callback function triggered when the system is running out of memory on mobile devices. +--- +---Mobile operating systems may forcefully kill the game if it uses too much memory, so any non-critical resource should be removed if possible (by setting all variables referencing the resources to '''nil'''), when this event is triggered. Sounds and images in particular tend to use the most memory. +--- +---@alias love.lowmemory fun() ----@type love.mousefocus +--- +---Callback function triggered when window receives or loses mouse focus. +--- +---@alias love.mousefocus fun(focus: boolean) ----@type love.mousemoved +--- +---Callback function triggered when the mouse is moved. +--- +---@alias love.mousemoved fun(x: number, y: number, dx: number, dy: number, istouch: boolean) ----@type love.mousepressed +--- +---Callback function triggered when a mouse button is pressed. +--- +---@alias love.mousepressed fun(x: number, y: number, button: number, istouch: boolean, presses: number) ----@type love.mousereleased +--- +---Callback function triggered when a mouse button is released. +--- +---@alias love.mousereleased fun(x: number, y: number, button: number, istouch: boolean, presses: number) ----@type love.quit +--- +---Callback function triggered when the game is closed. +--- +---@alias love.quit fun():boolean ----@type love.resize +--- +---Called when the window is resized, for example if the user resizes the window, or if love.window.setMode is called with an unsupported width or height in fullscreen and the window chooses the closest appropriate size. +--- +---@alias love.resize fun(w: number, h: number) ----@type love.run +--- +---The main function, containing the main loop. A sensible default is used when left out. +--- +---@alias love.run fun():function ----@type love.textedited +--- +---Called when the candidate text for an IME (Input Method Editor) has changed. +--- +---The candidate text is not the final text that the user will eventually choose. Use love.textinput for that. +--- +---@alias love.textedited fun(text: string, start: number, length: number) ----@type love.textinput +--- +---Called when text has been entered by the user. For example if shift-2 is pressed on an American keyboard layout, the text '@' will be generated. +--- +---@alias love.textinput fun(text: string) ----@type love.threaderror +--- +---Callback function triggered when a Thread encounters an error. +--- +---@alias love.threaderror fun(thread: love.Thread, errorstr: string) ----@type love.touchmoved +--- +---Callback function triggered when a touch press moves inside the touch screen. +--- +---@alias love.touchmoved fun(id: lightuserdata, x: number, y: number, dx: number, dy: number, pressure: number) ----@type love.touchpressed +--- +---Callback function triggered when the touch screen is touched. +--- +---@alias love.touchpressed fun(id: lightuserdata, x: number, y: number, dx: number, dy: number, pressure: number) ----@type love.touchreleased +--- +---Callback function triggered when the touch screen stops being touched. +--- +---@alias love.touchreleased fun(id: lightuserdata, x: number, y: number, dx: number, dy: number, pressure: number) ----@type love.update +--- +---Callback function used to update the state of the game every frame. +--- +---@alias love.update fun(dt: number) ----@type love.visible +--- +---Callback function triggered when window is minimized/hidden or unminimized by the user. +--- +---@alias love.visible fun(visible: boolean) ----@type love.wheelmoved +--- +---Callback function triggered when the mouse wheel is moved. +--- +---@alias love.wheelmoved fun(x: number, y: number) diff --git a/meta/3rd/love2d/library/love.math.lua b/meta/3rd/love2d/library/love.math.lua index 455a10c2..503051e3 100644 --- a/meta/3rd/love2d/library/love.math.lua +++ b/meta/3rd/love2d/library/love.math.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.math love.math = {} @@ -158,6 +159,11 @@ function love.math.setRandomState(state) end ---@return table triangles # List of triangles the polygon is composed of, in the form of {{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y3}, ...}. function love.math.triangulate(polygon) end +--- +---A Bézier curve object that can evaluate and render Bézier curves of arbitrary degree. +--- +---For more information on Bézier curves check this great article on Wikipedia. +--- ---@class love.BezierCurve: love.Object local BezierCurve = {} @@ -263,6 +269,9 @@ function BezierCurve:setControlPoint() end ---@param dy number # Offset along the y axis. function BezierCurve:translate(dx, dy) end +--- +---A random number generation object which has its own random state. +--- ---@class love.RandomGenerator: love.Object local RandomGenerator = {} @@ -311,6 +320,11 @@ function RandomGenerator:setSeed(seed) end ---@param state string # The new state of the RandomGenerator object, represented as a string. This should originate from a previous call to RandomGenerator:getState. function RandomGenerator:setState(state) end +--- +---Object containing a coordinate system transformation. +--- +---The love.graphics module has several functions and function variants which accept Transform objects. +--- ---@class love.Transform: love.Object local Transform = {} @@ -432,6 +446,15 @@ function Transform:transformPoint(globalX, globalY) end ---@return love.Transform transform # The Transform object the method was called on. Allows easily chaining Transform methods. function Transform:translate(dx, dy) end +--- +---The layout of matrix elements (row-major or column-major). +--- ---@class love.MatrixLayout ----@field row integer # The matrix is row-major: ----@field column integer # The matrix is column-major: +--- +---The matrix is row-major: +--- +---@field row integer +--- +---The matrix is column-major: +--- +---@field column integer diff --git a/meta/3rd/love2d/library/love.mouse.lua b/meta/3rd/love2d/library/love.mouse.lua index 9cd43c99..055252c7 100644 --- a/meta/3rd/love2d/library/love.mouse.lua +++ b/meta/3rd/love2d/library/love.mouse.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.mouse love.mouse = {} @@ -132,6 +133,9 @@ function love.mouse.setX() end --- function love.mouse.setY() end +--- +---Represents a hardware cursor. +--- ---@class love.Cursor: love.Object local Cursor = {} @@ -141,17 +145,59 @@ local Cursor = {} ---@return love.CursorType ctype # The type of the Cursor. function Cursor:getType() end +--- +---Types of hardware cursors. +--- ---@class love.CursorType ----@field image integer # The cursor is using a custom image. ----@field arrow integer # An arrow pointer. ----@field ibeam integer # An I-beam, normally used when mousing over editable or selectable text. ----@field wait integer # Wait graphic. ----@field waitarrow integer # Small wait cursor with an arrow pointer. ----@field crosshair integer # Crosshair symbol. ----@field sizenwse integer # Double arrow pointing to the top-left and bottom-right. ----@field sizenesw integer # Double arrow pointing to the top-right and bottom-left. ----@field sizewe integer # Double arrow pointing left and right. ----@field sizens integer # Double arrow pointing up and down. ----@field sizeall integer # Four-pointed arrow pointing up, down, left, and right. ----@field no integer # Slashed circle or crossbones. ----@field hand integer # Hand symbol. +--- +---The cursor is using a custom image. +--- +---@field image integer +--- +---An arrow pointer. +--- +---@field arrow integer +--- +---An I-beam, normally used when mousing over editable or selectable text. +--- +---@field ibeam integer +--- +---Wait graphic. +--- +---@field wait integer +--- +---Small wait cursor with an arrow pointer. +--- +---@field waitarrow integer +--- +---Crosshair symbol. +--- +---@field crosshair integer +--- +---Double arrow pointing to the top-left and bottom-right. +--- +---@field sizenwse integer +--- +---Double arrow pointing to the top-right and bottom-left. +--- +---@field sizenesw integer +--- +---Double arrow pointing left and right. +--- +---@field sizewe integer +--- +---Double arrow pointing up and down. +--- +---@field sizens integer +--- +---Four-pointed arrow pointing up, down, left, and right. +--- +---@field sizeall integer +--- +---Slashed circle or crossbones. +--- +---@field no integer +--- +---Hand symbol. +--- +---@field hand integer diff --git a/meta/3rd/love2d/library/love.physics.lua b/meta/3rd/love2d/library/love.physics.lua index 16d8d959..5b23957e 100644 --- a/meta/3rd/love2d/library/love.physics.lua +++ b/meta/3rd/love2d/library/love.physics.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.physics love.physics = {} @@ -265,6 +266,9 @@ function love.physics.newWorld(xg, yg, sleep) end ---@param scale number # The scale factor as an integer. function love.physics.setMeter(scale) end +--- +---Bodies are objects with velocity and position. +--- ---@class love.Body: love.Object local Body = {} @@ -776,6 +780,11 @@ function Body:setX() end --- function Body:setY() end +--- +---A ChainShape consists of multiple line segments. It can be used to create the boundaries of your terrain. The shape does not have volume and can only collide with PolygonShape and CircleShape. +--- +---Unlike the PolygonShape, the ChainShape does not have a vertices limit or has to form a convex shape, but self intersections are not supported. +--- ---@class love.ChainShape: love.Shape, love.Object local ChainShape = {} @@ -835,6 +844,9 @@ function ChainShape:setNextVertex() end --- function ChainShape:setPreviousVertex() end +--- +---Circle extends Shape and adds a radius and a local position. +--- ---@class love.CircleShape: love.Shape, love.Object local CircleShape = {} @@ -860,6 +872,9 @@ function CircleShape:setPoint() end ---@param radius number # The radius of the circle function CircleShape:setRadius(radius) end +--- +---Contacts are objects created to manage collisions in worlds. +--- ---@class love.Contact: love.Object local Contact = {} @@ -940,6 +955,9 @@ function Contact:setFriction(friction) end ---@param restitution number # The contact restitution. function Contact:setRestitution(restitution) end +--- +---Keeps two bodies at the same distance. +--- ---@class love.DistanceJoint: love.Joint, love.Object local DistanceJoint = {} @@ -977,6 +995,9 @@ function DistanceJoint:setFrequency(Hz) end --- function DistanceJoint:setLength() end +--- +---A EdgeShape is a line segment. They can be used to create the boundaries of your terrain. The shape does not have volume and can only collide with PolygonShape and CircleShape. +--- ---@class love.EdgeShape: love.Shape, love.Object local EdgeShape = {} @@ -1017,6 +1038,9 @@ function EdgeShape:setNextVertex() end --- function EdgeShape:setPreviousVertex() end +--- +---Fixtures attach shapes to bodies. +--- ---@class love.Fixture: love.Object local Fixture = {} @@ -1230,6 +1254,9 @@ function Fixture:setUserData(value) end ---@return boolean isInside # True if the point is inside or false if it is outside. function Fixture:testPoint() end +--- +---A FrictionJoint applies friction to a body. +--- ---@class love.FrictionJoint: love.Joint, love.Object local FrictionJoint = {} @@ -1257,6 +1284,9 @@ function FrictionJoint:setMaxForce(maxForce) end ---@param torque number # Maximum torque in Newton-meters. function FrictionJoint:setMaxTorque(torque) end +--- +---Keeps bodies together in such a way that they act like gears. +--- ---@class love.GearJoint: love.Joint, love.Object local GearJoint = {} @@ -1279,6 +1309,9 @@ function GearJoint:getRatio() end ---@param ratio number # The new ratio of the joint. function GearJoint:setRatio(ratio) end +--- +---Attach multiple bodies together to interact in unique ways. +--- ---@class love.Joint: love.Object local Joint = {} @@ -1350,6 +1383,9 @@ function Joint:isDestroyed() end ---@param value any # The Lua value to associate with the Joint. function Joint:setUserData(value) end +--- +---Controls the relative motion between two Bodies. Position and rotation offsets can be specified, as well as the maximum motor force and torque that will be applied to reach the target offsets. +--- ---@class love.MotorJoint: love.Joint, love.Object local MotorJoint = {} @@ -1375,6 +1411,9 @@ function MotorJoint:setAngularOffset(angleoffset) end --- function MotorJoint:setLinearOffset() end +--- +---For controlling objects with the mouse. +--- ---@class love.MouseJoint: love.Joint, love.Object local MouseJoint = {} @@ -1422,6 +1461,9 @@ function MouseJoint:setMaxForce() end --- function MouseJoint:setTarget() end +--- +---A PolygonShape is a convex polygon with up to 8 vertices. +--- ---@class love.PolygonShape: love.Shape, love.Object local PolygonShape = {} @@ -1436,6 +1478,9 @@ local PolygonShape = {} ---@return number y2 # The y-component of the second vertex. function PolygonShape:getPoints() end +--- +---Restricts relative motion between Bodies to one shared axis. +--- ---@class love.PrismaticJoint: love.Joint, love.Object local PrismaticJoint = {} @@ -1543,6 +1588,9 @@ function PrismaticJoint:setMotorSpeed() end ---@param upper number # The upper limit, usually in meters. function PrismaticJoint:setUpperLimit(upper) end +--- +---Allows you to simulate bodies connected through pulleys. +--- ---@class love.PulleyJoint: love.Joint, love.Object local PulleyJoint = {} @@ -1609,6 +1657,9 @@ function PulleyJoint:setMaxLengths(max1, max2) end ---@param ratio number # The new pulley ratio of the joint. function PulleyJoint:setRatio(ratio) end +--- +---Allow two Bodies to revolve around a shared point. +--- ---@class love.RevoluteJoint: love.Joint, love.Object local RevoluteJoint = {} @@ -1716,6 +1767,9 @@ function RevoluteJoint:setMotorSpeed() end ---@param upper number # The upper limit, in radians. function RevoluteJoint:setUpperLimit(upper) end +--- +---The RopeJoint enforces a maximum distance between two points on two bodies. It has no other effect. +--- ---@class love.RopeJoint: love.Joint, love.Object local RopeJoint = {} @@ -1731,6 +1785,13 @@ function RopeJoint:getMaxLength() end ---@param maxLength number # The new maximum length of the RopeJoint. function RopeJoint:setMaxLength(maxLength) end +--- +---Shapes are solid 2d geometrical objects which handle the mass and collision of a Body in love.physics. +--- +---Shapes are attached to a Body via a Fixture. The Shape object is copied when this happens. +--- +---The Shape's position is relative to the position of the Body it has been attached to. +--- ---@class love.Shape: love.Object local Shape = {} @@ -1809,6 +1870,9 @@ function Shape:rayCast(x1, y1, x2, y2, maxFraction, tx, ty, tr, childIndex) end ---@return boolean hit # True if inside, false if outside function Shape:testPoint(tx, ty, tr) end +--- +---A WeldJoint essentially glues two bodies together. +--- ---@class love.WeldJoint: love.Joint, love.Object local WeldJoint = {} @@ -1836,6 +1900,9 @@ function WeldJoint:setDampingRatio(ratio) end ---@param freq number # The new frequency in hertz. function WeldJoint:setFrequency(freq) end +--- +---Restricts a point on the second body to a line on the first body. +--- ---@class love.WheelJoint: love.Joint, love.Object local WheelJoint = {} @@ -1917,6 +1984,9 @@ function WheelJoint:setSpringDampingRatio(ratio) end ---@param freq number # The new frequency in hertz. function WheelJoint:setSpringFrequency(freq) end +--- +---A world is an object that contains all bodies and joints. +--- ---@class love.World: love.Object local World = {} @@ -2067,24 +2137,81 @@ function World:translateOrigin() end ---@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 +--- +---The types of a Body. +--- ---@class love.BodyType ----@field static integer # Static bodies do not move. ----@field dynamic integer # Dynamic bodies collide with all bodies. ----@field kinematic integer # Kinematic bodies only collide with dynamic bodies. +--- +---Static bodies do not move. +--- +---@field static integer +--- +---Dynamic bodies collide with all bodies. +--- +---@field dynamic integer +--- +---Kinematic bodies only collide with dynamic bodies. +--- +---@field kinematic integer +--- +---Different types of joints. +--- ---@class love.JointType ----@field distance integer # A DistanceJoint. ----@field friction integer # A FrictionJoint. ----@field gear integer # A GearJoint. ----@field mouse integer # A MouseJoint. ----@field prismatic integer # A PrismaticJoint. ----@field pulley integer # A PulleyJoint. ----@field revolute integer # A RevoluteJoint. ----@field rope integer # A RopeJoint. ----@field weld integer # A WeldJoint. +--- +---A DistanceJoint. +--- +---@field distance integer +--- +---A FrictionJoint. +--- +---@field friction integer +--- +---A GearJoint. +--- +---@field gear integer +--- +---A MouseJoint. +--- +---@field mouse integer +--- +---A PrismaticJoint. +--- +---@field prismatic integer +--- +---A PulleyJoint. +--- +---@field pulley integer +--- +---A RevoluteJoint. +--- +---@field revolute integer +--- +---A RopeJoint. +--- +---@field rope integer +--- +---A WeldJoint. +--- +---@field weld integer +--- +---The different types of Shapes, as returned by Shape:getType. +--- ---@class love.ShapeType ----@field circle integer # The Shape is a CircleShape. ----@field polygon integer # The Shape is a PolygonShape. ----@field edge integer # The Shape is a EdgeShape. ----@field chain integer # The Shape is a ChainShape. +--- +---The Shape is a CircleShape. +--- +---@field circle integer +--- +---The Shape is a PolygonShape. +--- +---@field polygon integer +--- +---The Shape is a EdgeShape. +--- +---@field edge integer +--- +---The Shape is a ChainShape. +--- +---@field chain integer diff --git a/meta/3rd/love2d/library/love.sound.lua b/meta/3rd/love2d/library/love.sound.lua index 1dcb7b72..8ca9fbbf 100644 --- a/meta/3rd/love2d/library/love.sound.lua +++ b/meta/3rd/love2d/library/love.sound.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.sound love.sound = {} @@ -20,6 +21,9 @@ function love.sound.newDecoder(file, buffer) end ---@return love.SoundData soundData # A new SoundData object. function love.sound.newSoundData(filename) end +--- +---An object which can gradually decode a sound file. +--- ---@class love.Decoder: love.Object local Decoder = {} @@ -55,6 +59,11 @@ function Decoder:getDuration() end ---@return number rate # Number of samples per second. function Decoder:getSampleRate() end +--- +---Contains raw audio samples. +--- +---You can not play SoundData back directly. You must wrap a Source object around it. +--- ---@class love.SoundData: love.Data, love.Object local SoundData = {} diff --git a/meta/3rd/love2d/library/love.system.lua b/meta/3rd/love2d/library/love.system.lua index 3ef2b82b..ed71a00b 100644 --- a/meta/3rd/love2d/library/love.system.lua +++ b/meta/3rd/love2d/library/love.system.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.system love.system = {} @@ -56,9 +57,27 @@ function love.system.setClipboardText(text) end ---@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 +--- +---The basic state of the system's power supply. +--- ---@class love.PowerState ----@field unknown integer # Cannot determine power status. ----@field battery integer # Not plugged in, running on a battery. ----@field nobattery integer # Plugged in, no battery available. ----@field charging integer # Plugged in, charging battery. ----@field charged integer # Plugged in, battery is fully charged. +--- +---Cannot determine power status. +--- +---@field unknown integer +--- +---Not plugged in, running on a battery. +--- +---@field battery integer +--- +---Plugged in, no battery available. +--- +---@field nobattery integer +--- +---Plugged in, charging battery. +--- +---@field charging integer +--- +---Plugged in, battery is fully charged. +--- +---@field charged integer diff --git a/meta/3rd/love2d/library/love.thread.lua b/meta/3rd/love2d/library/love.thread.lua index 4331da02..da0b7c56 100644 --- a/meta/3rd/love2d/library/love.thread.lua +++ b/meta/3rd/love2d/library/love.thread.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.thread love.thread = {} @@ -25,6 +26,9 @@ function love.thread.newChannel() end ---@return love.Thread thread # A new Thread that has yet to be started. function love.thread.newThread(filename) end +--- +---An object which can be used to send and receive data between different threads. +--- ---@class love.Channel: love.Object local Channel = {} @@ -100,6 +104,9 @@ function Channel:push(value) end ---@return boolean success # Whether the message was successfully supplied (always true). function Channel:supply(value) end +--- +---A Thread is a chunk of code that can run in parallel with other threads. Data can be sent between different threads with Channel objects. +--- ---@class love.Thread: love.Object local Thread = {} diff --git a/meta/3rd/love2d/library/love.timer.lua b/meta/3rd/love2d/library/love.timer.lua index cedb6a43..30a8f06c 100644 --- a/meta/3rd/love2d/library/love.timer.lua +++ b/meta/3rd/love2d/library/love.timer.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.timer love.timer = {} diff --git a/meta/3rd/love2d/library/love.touch.lua b/meta/3rd/love2d/library/love.touch.lua index 9ab497fa..9c7f7e10 100644 --- a/meta/3rd/love2d/library/love.touch.lua +++ b/meta/3rd/love2d/library/love.touch.lua @@ -1,18 +1,19 @@ ---@meta +-- version: nil ---@class love.touch love.touch = {} --- ---Gets the current position of the specified touch-press, in pixels. --- ----@param id love.light|userdata # The identifier of the touch-press. Use love.touch.getTouches, love.touchpressed, or love.touchmoved to obtain touch id values. +---@param id lightuserdata # The identifier of the touch-press. Use love.touch.getTouches, love.touchpressed, or love.touchmoved to obtain touch id values. function love.touch.getPosition(id) end --- ---Gets the current pressure of the specified touch-press. --- ----@param id love.light|userdata # The identifier of the touch-press. Use love.touch.getTouches, love.touchpressed, or love.touchmoved to obtain touch id values. +---@param id lightuserdata # The identifier of the touch-press. Use love.touch.getTouches, love.touchpressed, or love.touchmoved to obtain touch id values. ---@return number pressure # The pressure of the touch-press. Most touch screens aren't pressure sensitive, in which case the pressure will be 1. function love.touch.getPressure(id) end diff --git a/meta/3rd/love2d/library/love.video.lua b/meta/3rd/love2d/library/love.video.lua index 18d174b5..6be1694b 100644 --- a/meta/3rd/love2d/library/love.video.lua +++ b/meta/3rd/love2d/library/love.video.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.video love.video = {} @@ -10,5 +11,8 @@ love.video = {} ---@return love.VideoStream videostream # A new VideoStream. function love.video.newVideoStream(filename) end +--- +---An object which decodes, streams, and controls Videos. +--- ---@class love.VideoStream: love.Object local VideoStream = {} diff --git a/meta/3rd/love2d/library/love.window.lua b/meta/3rd/love2d/library/love.window.lua index 8d3e9dbf..e0ce54c9 100644 --- a/meta/3rd/love2d/library/love.window.lua +++ b/meta/3rd/love2d/library/love.window.lua @@ -1,5 +1,6 @@ ---@meta +-- version: nil ---@class love.window love.window = {} @@ -278,19 +279,61 @@ function love.window.toPixels(value) end ---@return boolean success # True if successful, false otherwise. function love.window.updateMode(width, height, settings) end +--- +---Types of device display orientation. +--- ---@class love.DisplayOrientation ----@field unknown integer # Orientation cannot be determined. ----@field landscape integer # Landscape orientation. ----@field landscapeflipped integer # Landscape orientation (flipped). ----@field portrait integer # Portrait orientation. ----@field portraitflipped integer # Portrait orientation (flipped). +--- +---Orientation cannot be determined. +--- +---@field unknown integer +--- +---Landscape orientation. +--- +---@field landscape integer +--- +---Landscape orientation (flipped). +--- +---@field landscapeflipped integer +--- +---Portrait orientation. +--- +---@field portrait integer +--- +---Portrait orientation (flipped). +--- +---@field portraitflipped integer +--- +---Types of fullscreen modes. +--- ---@class love.FullscreenType ----@field desktop integer # Sometimes known as borderless fullscreen windowed mode. A borderless screen-sized window is created which sits on top of all desktop UI elements. The window is automatically resized to match the dimensions of the desktop, and its size cannot be changed. ----@field exclusive integer # Standard exclusive-fullscreen mode. Changes the display mode (actual resolution) of the monitor. ----@field normal integer # Standard exclusive-fullscreen mode. Changes the display mode (actual resolution) of the monitor. +--- +---Sometimes known as borderless fullscreen windowed mode. A borderless screen-sized window is created which sits on top of all desktop UI elements. The window is automatically resized to match the dimensions of the desktop, and its size cannot be changed. +--- +---@field desktop integer +--- +---Standard exclusive-fullscreen mode. Changes the display mode (actual resolution) of the monitor. +--- +---@field exclusive integer +--- +---Standard exclusive-fullscreen mode. Changes the display mode (actual resolution) of the monitor. +--- +---@field normal integer +--- +---Types of message box dialogs. Different types may have slightly different looks. +--- ---@class love.MessageBoxType ----@field info integer # Informational dialog. ----@field warning integer # Warning dialog. ----@field error integer # Error dialog. +--- +---Informational dialog. +--- +---@field info integer +--- +---Warning dialog. +--- +---@field warning integer +--- +---Error dialog. +--- +---@field error integer diff --git a/tools/love-api.lua b/tools/love-api.lua index e4227d65..6817e9ff 100644 --- a/tools/love-api.lua +++ b/tools/love-api.lua @@ -26,16 +26,30 @@ local knownTypes = { ['light userdata'] = 'lightuserdata' } +local function trim(name) + name = name:gsub('^%s+', '') + name = name:gsub('%s+$', '') + return name +end + +---@param names string local function getTypeName(names) local types = {} - for name in names:gmatch '[%a_][%w_]+' do - if name ~= 'or' then - types[#types+1] = knownTypes[name] or ('love.' .. name) - end + names = names:gsub('%sor%s', '|') + for name in names:gmatch '[^|]+' do + name = trim(name) + types[#types+1] = knownTypes[name] or ('love.' .. name) end return table.concat(types, '|') end +local function formatIndex(key) + if key:match '^[%a_][%w_]+$' then + return key + end + return ('[%q]'):format(key) +end + local function buildType(param) if param.table then -- TODO @@ -56,14 +70,16 @@ local function buildSuper(tp) end local function buildDescription(desc) - return ('---%s'):format(desc:gsub('([\r\n])', '%1---')) + if desc then + return ('---\n---%s\n---'):format(desc:gsub('([\r\n])', '%1---')) + else + return nil + end end local function buildFunction(class, func, node) local text = {} - text[#text+1] = '---' text[#text+1] = buildDescription(func.description) - text[#text+1] = '---' local params = {} for _, param in ipairs(func.variants[1].arguments or {}) do for paramName in param.name:gmatch '[%a_][%w_]+' do @@ -92,12 +108,32 @@ local function buildFunction(class, func, node) return table.concat(text, '\n') end +local function buildDocFunc(tp) + local cbs = {} + for _, variant in ipairs(tp.variants) do + local params = {} + local returns = {} + for _, param in ipairs(variant.arguments or {}) do + params[#params+1] = ('%s: %s'):format(param.name, getTypeName(param.type)) + end + for _, rtn in ipairs(variant.returns or {}) do + returns[#returns+1] = ('%s'):format(getTypeName(rtn.type)) + end + cbs[#cbs+1] = ('fun(%s)%s'):format( + table.concat(params, ', '), + #returns > 0 and (':' .. table.concat(returns, ', ')) or '' + ) + end + return table.concat(cbs, '|') +end + local function buildFile(class, defs) local filePath = libraryPath / (class .. '.lua') local text = {} text[#text+1] = '---@meta' text[#text+1] = '' + text[#text+1] = ('-- version: %s'):format(defs.version) text[#text+1] = ('---@class %s'):format(class) text[#text+1] = ('%s = {}'):format(class) @@ -109,6 +145,7 @@ local function buildFile(class, defs) for _, tp in ipairs(defs.types or {}) do local mark = {} text[#text+1] = '' + text[#text+1] = buildDescription(tp.description) text[#text+1] = ('---@class %s%s'):format(getTypeName(tp.name), buildSuper(tp)) text[#text+1] = ('local %s = {}'):format(tp.name) for _, func in ipairs(tp.functions or {}) do @@ -120,17 +157,19 @@ local function buildFile(class, defs) end end - -- TODO - for _, tp in ipairs(defs.callbacks or {}) do + for _, cb in ipairs(defs.callbacks or {}) do text[#text+1] = '' - text[#text+1] = ('---@type %s'):format(getTypeName(tp.name)) + text[#text+1] = buildDescription(cb.description) + text[#text+1] = ('---@alias %s %s'):format(getTypeName(cb.name), buildDocFunc(cb)) end for _, enum in ipairs(defs.enums or {}) do text[#text+1] = '' + text[#text+1] = buildDescription(enum.description) text[#text+1] = ('---@class %s'):format(getTypeName(enum.name)) for _, constant in ipairs(enum.constants) do - text[#text+1] = ('---@field %s integer # %s'):format(constant.name, constant.description) + text[#text+1] = buildDescription(constant.description) + text[#text+1] = ('---@field %s integer'):format(formatIndex(constant.name)) end end |