Skip to content

Added links to all love2d functions in documentation #1752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 258 additions & 0 deletions meta/3rd/love2d/library/love/audio.lua

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions meta/3rd/love2d/library/love/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
---
---Provides functionality for creating and transforming data.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data)
---
---@class love.data
love.data = {}

---
---Compresses a string or data using a specific compression algorithm.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data.compress)
---
---@overload fun(container: love.ContainerType, format: love.CompressedDataFormat, data: love.Data, level?: number):love.CompressedData|string
---@param container love.ContainerType # What type to return the compressed data as.
---@param format love.CompressedDataFormat # The format to use when compressing the string.
Expand All @@ -20,6 +26,9 @@ function love.data.compress(container, format, rawstring, level) end
---
---Decode Data or a string from any of the EncodeFormats to Data or string.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data.decode)
---
---@overload fun(container: love.ContainerType, format: love.EncodeFormat, sourceData: love.Data):love.ByteData|string
---@param container love.ContainerType # What type to return the decoded data as.
---@param format love.EncodeFormat # The format of the input data.
Expand All @@ -30,6 +39,9 @@ function love.data.decode(container, format, sourceString) end
---
---Decompresses a CompressedData or previously compressed string or Data object.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data.decompress)
---
---@overload fun(container: love.ContainerType, format: love.CompressedDataFormat, compressedString: string):love.Data|string
---@overload fun(container: love.ContainerType, format: love.CompressedDataFormat, data: love.Data):love.Data|string
---@param container love.ContainerType # What type to return the decompressed data as.
Expand All @@ -40,6 +52,9 @@ function love.data.decompress(container, compressedData) end
---
---Encode Data or a string to a Data or string in one of the EncodeFormats.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data.encode)
---
---@overload fun(container: love.ContainerType, format: love.EncodeFormat, sourceData: love.Data, linelength?: number):love.ByteData|string
---@param container love.ContainerType # What type to return the encoded data as.
---@param format love.EncodeFormat # The format of the output data.
Expand All @@ -53,13 +68,19 @@ function love.data.encode(container, format, sourceString, linelength) end
---
---This function behaves the same as Lua 5.3's string.packsize.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data.getPackedSize)
---
---@param format string # A string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.
---@return number size # The size in bytes that the packed data will use.
function love.data.getPackedSize(format) end

---
---Compute the message digest of a string using a specified hash algorithm.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data.hash)
---
---@overload fun(hashFunction: love.HashFunction, data: love.Data):string
---@param hashFunction love.HashFunction # Hash algorithm to use.
---@param string string # String to hash.
Expand All @@ -71,6 +92,9 @@ function love.data.hash(hashFunction, string) end
---
---Data:getPointer along with LuaJIT's FFI can be used to manipulate the contents of the ByteData object after it has been created.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data.newByteData)
---
---@overload fun(Data: love.Data, offset?: number, size?: number):love.ByteData
---@overload fun(size: number):love.ByteData
---@param datastring string # The byte string to copy.
Expand All @@ -80,6 +104,9 @@ function love.data.newByteData(datastring) end
---
---Creates a new Data referencing a subsection of an existing Data object.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data.newDataView)
---
---@param data love.Data # The Data object to reference.
---@param offset number # The offset of the subsection to reference, in bytes.
---@param size number # The size in bytes of the subsection to reference.
Expand All @@ -91,6 +118,9 @@ function love.data.newDataView(data, offset, size) end
---
---This function behaves the same as Lua 5.3's string.pack.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data.pack)
---
---@param container love.ContainerType # What type to return the encoded data as.
---@param format string # A string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.
---@param v1 number|boolean|string # The first value (number, boolean, or string) to serialize.
Expand All @@ -103,6 +133,9 @@ function love.data.pack(container, format, v1, ...) end
---
---This function behaves the same as Lua 5.3's string.unpack.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data.unpack)
---
---@overload fun(format: string, data: love.Data, pos?: number):number|boolean|string, number|boolean|string, number
---@param format string # A string determining how the values were packed. Follows the rules of Lua 5.3's string.pack format strings.
---@param datastring string # A string containing the packed (serialized) data.
Expand All @@ -116,6 +149,9 @@ function love.data.unpack(format, datastring, pos) end
---
---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.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data)
---
---@class love.ByteData: love.Object, love.Data
local ByteData = {}

Expand All @@ -124,18 +160,27 @@ local ByteData = {}
---
---love.data.decompress can be used to de-compress the data (or love.math.decompress in 0.10.2 or earlier).
---
---
---[Open in Browser](https://love2d.org/wiki/love.data)
---
---@class love.CompressedData: love.Data, love.Object
local CompressedData = {}

---
---Gets the compression format of the CompressedData.
---
---
---[Open in Browser](https://love2d.org/wiki/CompressedData:getFormat)
---
---@return love.CompressedDataFormat format # The format of the CompressedData.
function CompressedData:getFormat() end

---
---Compressed data formats.
---
---
---[Open in Browser](https://love2d.org/wiki/CompressedDataFormat)
---
---@alias love.CompressedDataFormat
---
---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.
Expand All @@ -157,6 +202,9 @@ function CompressedData:getFormat() end
---
---Return type of various data-returning functions.
---
---
---[Open in Browser](https://love2d.org/wiki/ContainerType)
---
---@alias love.ContainerType
---
---Return type is ByteData.
Expand All @@ -170,6 +218,9 @@ function CompressedData:getFormat() end
---
---Encoding format used to encode or decode data.
---
---
---[Open in Browser](https://love2d.org/wiki/EncodeFormat)
---
---@alias love.EncodeFormat
---
---Encode/decode data as base64 binary-to-text encoding.
Expand All @@ -183,6 +234,9 @@ function CompressedData:getFormat() end
---
---Hash algorithm of love.data.hash.
---
---
---[Open in Browser](https://love2d.org/wiki/HashFunction)
---
---@alias love.HashFunction
---
---MD5 hash algorithm (16 bytes).
Expand Down
24 changes: 24 additions & 0 deletions meta/3rd/love2d/library/love/event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@
---
---Manages events, like keypresses.
---
---
---[Open in Browser](https://love2d.org/wiki/love.event)
---
---@class love.event
love.event = {}

---
---Clears the event queue.
---
---
---[Open in Browser](https://love2d.org/wiki/love.event.clear)
---
function love.event.clear() end

---
---Returns an iterator for messages in the event queue.
---
---
---[Open in Browser](https://love2d.org/wiki/love.event.poll)
---
---@return function i # Iterator function usable in a for loop.
function love.event.poll() end

Expand All @@ -26,13 +35,19 @@ function love.event.poll() end
---
---and if you want to handle OS-generated events at all (think callbacks).
---
---
---[Open in Browser](https://love2d.org/wiki/love.event.pump)
---
function love.event.pump() end

---
---Adds an event to the event queue.
---
---From 0.10.0 onwards, you may pass an arbitrary amount of arguments with this function, though the default callbacks don't ever use more than six.
---
---
---[Open in Browser](https://love2d.org/wiki/love.event.push)
---
---@param n love.Event # The name of the event.
---@param a? any # First event argument.
---@param b? any # Second event argument.
Expand All @@ -48,13 +63,19 @@ function love.event.push(n, a, b, c, d, e, f, ...) end
---
---The quit event is a signal for the event handler to close LÖVE. It's possible to abort the exit process with the love.quit callback.
---
---
---[Open in Browser](https://love2d.org/wiki/love.event.quit)
---
---@overload fun('restart': string|'restart')
---@param exitstatus? number # The program exit status to use when closing the application.
function love.event.quit(exitstatus) end

---
---Like love.event.poll(), but blocks until there is an event in the queue.
---
---
---[Open in Browser](https://love2d.org/wiki/love.event.wait)
---
---@return love.Event n # The name of event.
---@return any a # First event argument.
---@return any b # Second event argument.
Expand All @@ -69,6 +90,9 @@ function love.event.wait() end
---
---Since 0.8.0, event names are no longer abbreviated.
---
---
---[Open in Browser](https://love2d.org/wiki/Event)
---
---@alias love.Event
---
---Window focus gained or lost
Expand Down
Loading