Skip to content
Snippets Groups Projects
Unverified Commit e2b951f1 authored by carsakiller's avatar carsakiller
Browse files

refactor: replace love2d with LuaCATS submodule

parent ad1341b4
No related branches found
No related tags found
No related merge requests found
Showing
with 4 additions and 14236 deletions
...@@ -40,3 +40,6 @@ ...@@ -40,3 +40,6 @@
[submodule "meta/3rd/lfs"] [submodule "meta/3rd/lfs"]
path = meta/3rd/lfs path = meta/3rd/lfs
url = https://github.com/LuaCATS/luafilesystem.git url = https://github.com/LuaCATS/luafilesystem.git
[submodule "meta/3rd/love2d"]
path = meta/3rd/love2d
url = https://github.com/LuaCATS/love2d.git
Subproject commit dad72a7eae31f35bf4c6529e5b81f6187b5b7377
{
"name" : "LÖVE",
"words" : ["love%.%w+"],
"settings" : {
"Lua.runtime.version" : "LuaJIT",
"Lua.runtime.special" : {
"love.filesystem.load" : "loadfile"
}
}
}
---@meta
-- version: 11.4
---
---[Open in Browser](https://love2d.org/wiki/love)
---
---@class love
love = {}
---
---Gets the current running version of LÖVE.
---
---
---[Open in Browser](https://love2d.org/wiki/love.getVersion)
---
---@return number major # The major version of LÖVE, i.e. 0 for version 0.9.1.
---@return number minor # The minor version of LÖVE, i.e. 9 for version 0.9.1.
---@return number revision # The revision version of LÖVE, i.e. 1 for version 0.9.1.
---@return string codename # The codename of the current version, i.e. 'Baby Inspector' for version 0.9.1.
function love.getVersion() end
---
---Gets whether LÖVE displays warnings when using deprecated functionality. It is disabled by default in fused mode, and enabled by default otherwise.
---
---When deprecation output is enabled, the first use of a formally deprecated LÖVE API will show a message at the bottom of the screen for a short time, and print the message to the console.
---
---
---[Open in Browser](https://love2d.org/wiki/love.hasDeprecationOutput)
---
---@return boolean enabled # Whether deprecation output is enabled.
function love.hasDeprecationOutput() end
---
---Gets whether the given version is compatible with the current running version of LÖVE.
---
---
---[Open in Browser](https://love2d.org/wiki/love.isVersionCompatible)
---
---@overload fun(major: number, minor: number, revision: number):boolean
---@param version string # The version to check (for example '11.3' or '0.10.2').
---@return boolean compatible # Whether the given version is compatible with the current running version of LÖVE.
function love.isVersionCompatible(version) end
---
---Sets whether LÖVE displays warnings when using deprecated functionality. It is disabled by default in fused mode, and enabled by default otherwise.
---
---When deprecation output is enabled, the first use of a formally deprecated LÖVE API will show a message at the bottom of the screen for a short time, and print the message to the console.
---
---
---[Open in Browser](https://love2d.org/wiki/love.setDeprecationOutput)
---
---@param enable boolean # Whether to enable or disable deprecation output.
function love.setDeprecationOutput(enable) end
---
---The superclass of all data.
---
---
---[Open in Browser](https://love2d.org/wiki/love)
---
---@class love.Data: love.Object
local Data = {}
---
---Creates a new copy of the Data object.
---
---
---[Open in Browser](https://love2d.org/wiki/Data:clone)
---
---@return love.Data clone # The new copy.
function Data:clone() end
---
---Gets an FFI pointer to the Data.
---
---This function should be preferred instead of Data:getPointer because the latter uses light userdata which can't store more all possible memory addresses on some new ARM64 architectures, when LuaJIT is used.
---
---
---[Open in Browser](https://love2d.org/wiki/Data:getFFIPointer)
---
---@return ffi.cdata* pointer # A raw void* pointer to the Data, or nil if FFI is unavailable.
function Data:getFFIPointer() end
---
---Gets a pointer to the Data. Can be used with libraries such as LuaJIT's FFI.
---
---
---[Open in Browser](https://love2d.org/wiki/Data:getPointer)
---
---@return lightuserdata pointer # A raw pointer to the Data.
function Data:getPointer() end
---
---Gets the Data's size in bytes.
---
---
---[Open in Browser](https://love2d.org/wiki/Data:getSize)
---
---@return number size # The size of the Data in bytes.
function Data:getSize() end
---
---Gets the full Data as a string.
---
---
---[Open in Browser](https://love2d.org/wiki/Data:getString)
---
---@return string data # The raw data.
function Data:getString() end
---
---The superclass of all LÖVE types.
---
---
---[Open in Browser](https://love2d.org/wiki/love)
---
---@class love.Object
local Object = {}
---
---Destroys the object's Lua reference. The object will be completely deleted if it's not referenced by any other LÖVE object or thread.
---
---This method can be used to immediately clean up resources without waiting for Lua's garbage collector.
---
---
---[Open in Browser](https://love2d.org/wiki/Object:release)
---
---@return boolean success # True if the object was released by this call, false if it had been previously released.
function Object:release() end
---
---Gets the type of the object as a string.
---
---
---[Open in Browser](https://love2d.org/wiki/Object:type)
---
---@return string type # The type as a string.
function Object:type() end
---
---Checks whether an object is of a certain type. If the object has the type with the specified name in its hierarchy, this function will return true.
---
---
---[Open in Browser](https://love2d.org/wiki/Object:typeOf)
---
---@param name string # The name of the type to check for.
---@return boolean b # True if the object is of the specified type, false otherwise.
function Object:typeOf(name) end
---
---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)
---
---Callback function triggered when a directory is dragged and dropped onto the window.
---
---@alias love.directorydropped fun(path: string)
---
---Called when the device display orientation changed, for example, user rotated their phone 180 degrees.
---
---@alias love.displayrotated fun(index: number, orientation: love.DisplayOrientation)
---
---Callback function used to draw on the screen every frame.
---
---@alias love.draw fun()
---
---The error handler, used to display error messages.
---
---@alias love.errorhandler fun(msg: string):function
---
---Callback function triggered when a file is dragged and dropped onto the window.
---
---@alias love.filedropped fun(file: love.DroppedFile)
---
---Callback function triggered when window receives or loses focus.
---
---@alias love.focus fun(focus: boolean)
---
---Called when a Joystick's virtual gamepad axis is moved.
---
---@alias love.gamepadaxis fun(joystick: love.Joystick, axis: love.GamepadAxis, value: number)
---
---Called when a Joystick's virtual gamepad button is pressed.
---
---@alias love.gamepadpressed fun(joystick: love.Joystick, button: love.GamepadButton)
---
---Called when a Joystick's virtual gamepad button is released.
---
---@alias love.gamepadreleased fun(joystick: love.Joystick, button: love.GamepadButton)
---
---Called when a Joystick is connected.
---
---@alias love.joystickadded fun(joystick: love.Joystick)
---
---Called when a joystick axis moves.
---
---@alias love.joystickaxis fun(joystick: love.Joystick, axis: number, value: number)
---
---Called when a joystick hat direction changes.
---
---@alias love.joystickhat fun(joystick: love.Joystick, hat: number, direction: love.JoystickHat)
---
---Called when a joystick button is pressed.
---
---@alias love.joystickpressed fun(joystick: love.Joystick, button: number)
---
---Called when a joystick button is released.
---
---@alias love.joystickreleased fun(joystick: love.Joystick, button: number)
---
---Called when a Joystick is disconnected.
---
---@alias love.joystickremoved fun(joystick: love.Joystick)
---
---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)
---
---Callback function triggered when a keyboard key is released.
---
---@alias love.keyreleased fun(key: love.KeyConstant, scancode: love.Scancode)
---
---This function is called exactly once at the beginning of the game.
---
---@alias love.load fun(arg: table, unfilteredArg: table)
---
---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()
---
---Callback function triggered when window receives or loses mouse focus.
---
---@alias love.mousefocus fun(focus: boolean)
---
---Callback function triggered when the mouse is moved.
---
---@alias love.mousemoved fun(x: number, y: number, dx: number, dy: number, istouch: boolean)
---
---Callback function triggered when a mouse button is pressed.
---
---@alias love.mousepressed fun(x: number, y: number, button: number, istouch: boolean, presses: number)
---
---Callback function triggered when a mouse button is released.
---
---@alias love.mousereleased fun(x: number, y: number, button: number, istouch: boolean, presses: number)
---
---Callback function triggered when the game is closed.
---
---@alias love.quit fun():boolean
---
---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)
---
---The main function, containing the main loop. A sensible default is used when left out.
---
---@alias love.run fun():function
---
---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)
---
---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)
---
---Callback function triggered when a Thread encounters an error.
---
---@alias love.threaderror fun(thread: love.Thread, errorstr: string)
---
---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)
---
---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)
---
---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)
---
---Callback function used to update the state of the game every frame.
---
---@alias love.update fun(dt: number)
---
---Callback function triggered when window is minimized/hidden or unminimized by the user.
---
---@alias love.visible fun(visible: boolean)
---
---Callback function triggered when the mouse wheel is moved.
---
---@alias love.wheelmoved fun(x: number, y: number)
return love
This diff is collapsed.
---@meta
---
---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.
---@param rawstring string # The raw (un-compressed) string to compress.
---@param level? number # The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used.
---@return love.CompressedData|string compressedData # CompressedData/string which contains the compressed version of rawstring.
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.
---@param sourceString string # The raw (encoded) data to decode.
---@return love.ByteData|string decoded # ByteData/string which contains the decoded version of source.
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.
---@param compressedData love.CompressedData # The compressed data to decompress.
---@return love.Data|string decompressedData # Data/string containing the raw decompressed data.
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.
---@param sourceString string # The raw data to encode.
---@param linelength? number # The maximum line length of the output. Only supported for base64, ignored if 0.
---@return love.ByteData|string encoded # ByteData/string which contains the encoded version of source.
function love.data.encode(container, format, sourceString, linelength) end
---
---Gets the size in bytes that a given format used with love.data.pack will use.
---
---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.
---@return string rawdigest # Raw message digest string.
function love.data.hash(hashFunction, string) end
---
---Creates a new Data object containing arbitrary bytes.
---
---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.
---@return love.ByteData bytedata # The new Data object.
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.
---@return love.Data view # The new Data view.
function love.data.newDataView(data, offset, size) end
---
---Packs (serializes) simple Lua values.
---
---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.
---@vararg number|boolean|string # Additional values to serialize.
---@return love.Data|string data # Data/string which contains the serialized data.
function love.data.pack(container, format, v1, ...) end
---
---Unpacks (deserializes) a byte-string or Data into simple Lua values.
---
---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.
---@param pos? number # Where to start reading in the string. Negative values can be used to read relative from the end of the string.
---@return number|boolean|string v1 # The first value (number, boolean, or string) that was unpacked.
---@return number index # The index of the first unread byte in the data string.
function love.data.unpack(format, datastring, pos) end
---
---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.
---
---
---[Open in Browser](https://love2d.org/wiki/love.data)
---
---@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).
---
---
---[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.
---
---| "lz4"
---
---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.
---
---| "zlib"
---
---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.
---
---| "gzip"
---
---Raw DEFLATE-compressed data (no header).
---
---| "deflate"
---
---Return type of various data-returning functions.
---
---
---[Open in Browser](https://love2d.org/wiki/ContainerType)
---
---@alias love.ContainerType
---
---Return type is ByteData.
---
---| "data"
---
---Return type is string.
---
---| "string"
---
---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.
---
---| "base64"
---
---Encode/decode data as hexadecimal string.
---
---| "hex"
---
---Hash algorithm of love.data.hash.
---
---
---[Open in Browser](https://love2d.org/wiki/HashFunction)
---
---@alias love.HashFunction
---
---MD5 hash algorithm (16 bytes).
---
---| "md5"
---
---SHA1 hash algorithm (20 bytes).
---
---| "sha1"
---
---SHA2 hash algorithm with message digest size of 224 bits (28 bytes).
---
---| "sha224"
---
---SHA2 hash algorithm with message digest size of 256 bits (32 bytes).
---
---| "sha256"
---
---SHA2 hash algorithm with message digest size of 384 bits (48 bytes).
---
---| "sha384"
---
---SHA2 hash algorithm with message digest size of 512 bits (64 bytes).
---
---| "sha512"
---@meta
---
---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
---
---Pump events into the event queue.
---
---This is a low-level function, and is usually not called by the user, but by love.run.
---
---Note that this does need to be called for any OS to think you're still running,
---
---and if you want to handle OS-generated events at all (think callbacks).
---
---
---[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.
---@param c? any # Third event argument.
---@param d? any # Fourth event argument.
---@param e? any # Fifth event argument.
---@param f? any # Sixth event argument.
---@vararg any # Further event arguments may follow.
function love.event.push(n, a, b, c, d, e, f, ...) end
---
---Adds the quit event to the queue.
---
---The quit event is a signal for the event handler to close LÖVE. It's possible to abort the exit process with the love.quit callback.
---
---
---[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.
---@return any c # Third event argument.
---@return any d # Fourth event argument.
---@return any e # Fifth event argument.
---@return any f # Sixth event argument.
function love.event.wait() end
---
---Arguments to love.event.push() and the like.
---
---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
---
---| "focus"
---
---Joystick pressed
---
---| "joystickpressed"
---
---Joystick released
---
---| "joystickreleased"
---
---Key pressed
---
---| "keypressed"
---
---Key released
---
---| "keyreleased"
---
---Mouse pressed
---
---| "mousepressed"
---
---Mouse released
---
---| "mousereleased"
---
---Quit
---
---| "quit"
---
---Window size changed by the user
---
---| "resize"
---
---Window is minimized or un-minimized by the user
---
---| "visible"
---
---Window mouse focus gained or lost
---
---| "mousefocus"
---
---A Lua error has occurred in a thread
---
---| "threaderror"
---
---Joystick connected
---
---| "joystickadded"
---
---Joystick disconnected
---
---| "joystickremoved"
---
---Joystick axis motion
---
---| "joystickaxis"
---
---Joystick hat pressed
---
---| "joystickhat"
---
---Joystick's virtual gamepad button pressed
---
---| "gamepadpressed"
---
---Joystick's virtual gamepad button released
---
---| "gamepadreleased"
---
---Joystick's virtual gamepad axis moved
---
---| "gamepadaxis"
---
---User entered text
---
---| "textinput"
---
---Mouse position changed
---
---| "mousemoved"
---
---Running out of memory on mobile devices system
---
---| "lowmemory"
---
---Candidate text for an IME changed
---
---| "textedited"
---
---Mouse wheel moved
---
---| "wheelmoved"
---
---Touch screen touched
---
---| "touchpressed"
---
---Touch screen stop touching
---
---| "touchreleased"
---
---Touch press moved inside touch screen
---
---| "touchmoved"
---
---Directory is dragged and dropped onto the window
---
---| "directorydropped"
---
---File is dragged and dropped onto the window.
---
---| "filedropped"
---
---Joystick pressed
---
---| "jp"
---
---Joystick released
---
---| "jr"
---
---Key pressed
---
---| "kp"
---
---Key released
---
---| "kr"
---
---Mouse pressed
---
---| "mp"
---
---Mouse released
---
---| "mr"
---
---Quit
---
---| "q"
---
---Window focus gained or lost
---
---| "f"
This diff is collapsed.
---@meta
---
---Allows you to work with fonts.
---
---
---[Open in Browser](https://love2d.org/wiki/love.font)
---
---@class love.font
love.font = {}
---
---Creates a new BMFont Rasterizer.
---
---
---[Open in Browser](https://love2d.org/wiki/love.font.newBMFontRasterizer)
---
---@overload fun(fileName: string, glyphs: string, dpiscale?: number):love.Rasterizer
---@param imageData love.ImageData # The image data containing the drawable pictures of font glyphs.
---@param glyphs string # The sequence of glyphs in the ImageData.
---@param dpiscale? number # DPI scale.
---@return love.Rasterizer rasterizer # The rasterizer.
function love.font.newBMFontRasterizer(imageData, glyphs, dpiscale) end
---
---Creates a new GlyphData.
---
---
---[Open in Browser](https://love2d.org/wiki/love.font.newGlyphData)
---
---@param rasterizer love.Rasterizer # The Rasterizer containing the font.
---@param glyph number # The character code of the glyph.
function love.font.newGlyphData(rasterizer, glyph) end
---
---Creates a new Image Rasterizer.
---
---
---[Open in Browser](https://love2d.org/wiki/love.font.newImageRasterizer)
---
---@param imageData love.ImageData # Font image data.
---@param glyphs string # String containing font glyphs.
---@param extraSpacing? number # Font extra spacing.
---@param dpiscale? number # Font DPI scale.
---@return love.Rasterizer rasterizer # The rasterizer.
function love.font.newImageRasterizer(imageData, glyphs, extraSpacing, dpiscale) end
---
---Creates a new Rasterizer.
---
---
---[Open in Browser](https://love2d.org/wiki/love.font.newRasterizer)
---
---@overload fun(data: love.FileData):love.Rasterizer
---@overload fun(size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Rasterizer
---@overload fun(fileName: string, size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Rasterizer
---@overload fun(fileData: love.FileData, size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Rasterizer
---@overload fun(imageData: love.ImageData, glyphs: string, dpiscale?: number):love.Rasterizer
---@overload fun(fileName: string, glyphs: string, dpiscale?: number):love.Rasterizer
---@param filename string # The font file.
---@return love.Rasterizer rasterizer # The rasterizer.
function love.font.newRasterizer(filename) end
---
---Creates a new TrueType Rasterizer.
---
---
---[Open in Browser](https://love2d.org/wiki/love.font.newTrueTypeRasterizer)
---
---@overload fun(fileName: string, size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Rasterizer
---@overload fun(fileData: love.FileData, size?: number, hinting?: love.HintingMode, dpiscale?: number):love.Rasterizer
---@param size? number # The font size.
---@param hinting? love.HintingMode # True Type hinting mode.
---@param dpiscale? number # The font DPI scale.
---@return love.Rasterizer rasterizer # The rasterizer.
function love.font.newTrueTypeRasterizer(size, hinting, dpiscale) end
---
---A GlyphData represents a drawable symbol of a font Rasterizer.
---
---
---[Open in Browser](https://love2d.org/wiki/love.font)
---
---@class love.GlyphData: love.Data, love.Object
local GlyphData = {}
---
---Gets glyph advance.
---
---
---[Open in Browser](https://love2d.org/wiki/GlyphData:getAdvance)
---
---@return number advance # Glyph advance.
function GlyphData:getAdvance() end
---
---Gets glyph bearing.
---
---
---[Open in Browser](https://love2d.org/wiki/GlyphData:getBearing)
---
---@return number bx # Glyph bearing X.
---@return number by # Glyph bearing Y.
function GlyphData:getBearing() end
---
---Gets glyph bounding box.
---
---
---[Open in Browser](https://love2d.org/wiki/GlyphData:getBoundingBox)
---
---@return number x # Glyph position x.
---@return number y # Glyph position y.
---@return number width # Glyph width.
---@return number height # Glyph height.
function GlyphData:getBoundingBox() end
---
---Gets glyph dimensions.
---
---
---[Open in Browser](https://love2d.org/wiki/GlyphData:getDimensions)
---
---@return number width # Glyph width.
---@return number height # Glyph height.
function GlyphData:getDimensions() end
---
---Gets glyph pixel format.
---
---
---[Open in Browser](https://love2d.org/wiki/GlyphData:getFormat)
---
---@return love.PixelFormat format # Glyph pixel format.
function GlyphData:getFormat() end
---
---Gets glyph number.
---
---
---[Open in Browser](https://love2d.org/wiki/GlyphData:getGlyph)
---
---@return number glyph # Glyph number.
function GlyphData:getGlyph() end
---
---Gets glyph string.
---
---
---[Open in Browser](https://love2d.org/wiki/GlyphData:getGlyphString)
---
---@return string glyph # Glyph string.
function GlyphData:getGlyphString() end
---
---Gets glyph height.
---
---
---[Open in Browser](https://love2d.org/wiki/GlyphData:getHeight)
---
---@return number height # Glyph height.
function GlyphData:getHeight() end
---
---Gets glyph width.
---
---
---[Open in Browser](https://love2d.org/wiki/GlyphData:getWidth)
---
---@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.
---
---
---[Open in Browser](https://love2d.org/wiki/love.font)
---
---@class love.Rasterizer: love.Object
local Rasterizer = {}
---
---Gets font advance.
---
---
---[Open in Browser](https://love2d.org/wiki/Rasterizer:getAdvance)
---
---@return number advance # Font advance.
function Rasterizer:getAdvance() end
---
---Gets ascent height.
---
---
---[Open in Browser](https://love2d.org/wiki/Rasterizer:getAscent)
---
---@return number height # Ascent height.
function Rasterizer:getAscent() end
---
---Gets descent height.
---
---
---[Open in Browser](https://love2d.org/wiki/Rasterizer:getDescent)
---
---@return number height # Descent height.
function Rasterizer:getDescent() end
---
---Gets number of glyphs in font.
---
---
---[Open in Browser](https://love2d.org/wiki/Rasterizer:getGlyphCount)
---
---@return number count # Glyphs count.
function Rasterizer:getGlyphCount() end
---
---Gets glyph data of a specified glyph.
---
---
---[Open in Browser](https://love2d.org/wiki/Rasterizer:getGlyphData)
---
---@overload fun(self: love.Rasterizer, glyphNumber: number):love.GlyphData
---@param glyph string # Glyph
---@return love.GlyphData glyphData # Glyph data
function Rasterizer:getGlyphData(glyph) end
---
---Gets font height.
---
---
---[Open in Browser](https://love2d.org/wiki/Rasterizer:getHeight)
---
---@return number height # Font height
function Rasterizer:getHeight() end
---
---Gets line height of a font.
---
---
---[Open in Browser](https://love2d.org/wiki/Rasterizer:getLineHeight)
---
---@return number height # Line height of a font.
function Rasterizer:getLineHeight() end
---
---Checks if font contains specified glyphs.
---
---
---[Open in Browser](https://love2d.org/wiki/Rasterizer:hasGlyphs)
---
---@param glyph1 string|number # Glyph
---@param glyph2 string|number # Glyph
---@vararg string|number # Additional glyphs
---@return boolean hasGlyphs # Whatever font contains specified glyphs.
function Rasterizer:hasGlyphs(glyph1, glyph2, ...) end
---
---True Type hinting mode.
---
---
---[Open in Browser](https://love2d.org/wiki/HintingMode)
---
---@alias love.HintingMode
---
---Default hinting. Should be preferred for typical antialiased fonts.
---
---| "normal"
---
---Results in fuzzier text but can sometimes preserve the original glyph shapes of the text better than normal hinting.
---
---| "light"
---
---Results in aliased / unsmoothed text with either full opacity or completely transparent pixels. Should be used when antialiasing is not desired for the font.
---
---| "mono"
---
---Disables hinting for the font. Results in fuzzier text.
---
---| "none"
This diff is collapsed.
This diff is collapsed.
---@meta
---
---Provides an interface to the user's joystick.
---
---
---[Open in Browser](https://love2d.org/wiki/love.joystick)
---
---@class love.joystick
love.joystick = {}
---
---Gets the full gamepad mapping string of the Joysticks which have the given GUID, or nil if the GUID isn't recognized as a gamepad.
---
---The mapping string contains binding information used to map the Joystick's buttons an axes to the standard gamepad layout, and can be used later with love.joystick.loadGamepadMappings.
---
---
---[Open in Browser](https://love2d.org/wiki/love.joystick.getGamepadMappingString)
---
---@param guid string # The GUID value to get the mapping string for.
---@return string mappingstring # A string containing the Joystick's gamepad mappings, or nil if the GUID is not recognized as a gamepad.
function love.joystick.getGamepadMappingString(guid) end
---
---Gets the number of connected joysticks.
---
---
---[Open in Browser](https://love2d.org/wiki/love.joystick.getJoystickCount)
---
---@return number joystickcount # The number of connected joysticks.
function love.joystick.getJoystickCount() end
---
---Gets a list of connected Joysticks.
---
---
---[Open in Browser](https://love2d.org/wiki/love.joystick.getJoysticks)
---
---@return table joysticks # The list of currently connected Joysticks.
function love.joystick.getJoysticks() end
---
---Loads a gamepad mappings string or file created with love.joystick.saveGamepadMappings.
---
---It also recognizes any SDL gamecontroller mapping string, such as those created with Steam's Big Picture controller configure interface, or this nice database. If a new mapping is loaded for an already known controller GUID, the later version will overwrite the one currently loaded.
---
---
---[Open in Browser](https://love2d.org/wiki/love.joystick.loadGamepadMappings)
---
---@overload fun(mappings: string)
---@param filename string # The filename to load the mappings string from.
function love.joystick.loadGamepadMappings(filename) end
---
---Saves the virtual gamepad mappings of all recognized as gamepads and have either been recently used or their gamepad bindings have been modified.
---
---The mappings are stored as a string for use with love.joystick.loadGamepadMappings.
---
---
---[Open in Browser](https://love2d.org/wiki/love.joystick.saveGamepadMappings)
---
---@overload fun():string
---@param filename string # The filename to save the mappings string to.
---@return string mappings # The mappings string that was written to the file.
function love.joystick.saveGamepadMappings(filename) end
---
---Binds a virtual gamepad input to a button, axis or hat for all Joysticks of a certain type. For example, if this function is used with a GUID returned by a Dualshock 3 controller in OS X, the binding will affect Joystick:getGamepadAxis and Joystick:isGamepadDown for ''all'' Dualshock 3 controllers used with the game when run in OS X.
---
---LÖVE includes built-in gamepad bindings for many common controllers. This function lets you change the bindings or add new ones for types of Joysticks which aren't recognized as gamepads by default.
---
---The virtual gamepad buttons and axes are designed around the Xbox 360 controller layout.
---
---
---[Open in Browser](https://love2d.org/wiki/love.joystick.setGamepadMapping)
---
---@overload fun(guid: string, axis: love.GamepadAxis, inputtype: love.JoystickInputType, inputindex: number, hatdir?: love.JoystickHat):boolean
---@param guid string # The OS-dependent GUID for the type of Joystick the binding will affect.
---@param button love.GamepadButton # The virtual gamepad button to bind.
---@param inputtype love.JoystickInputType # The type of input to bind the virtual gamepad button to.
---@param inputindex number # The index of the axis, button, or hat to bind the virtual gamepad button to.
---@param hatdir? love.JoystickHat # The direction of the hat, if the virtual gamepad button will be bound to a hat. nil otherwise.
---@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.
---
---
---[Open in Browser](https://love2d.org/wiki/love.joystick)
---
---@class love.Joystick: love.Object
local Joystick = {}
---
---Gets the direction of each axis.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getAxes)
---
---@return number axisDir1 # Direction of axis1.
---@return number axisDir2 # Direction of axis2.
---@return number axisDirN # Direction of axisN.
function Joystick:getAxes() end
---
---Gets the direction of an axis.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getAxis)
---
---@param axis number # The index of the axis to be checked.
---@return number direction # Current value of the axis.
function Joystick:getAxis(axis) end
---
---Gets the number of axes on the joystick.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getAxisCount)
---
---@return number axes # The number of axes available.
function Joystick:getAxisCount() end
---
---Gets the number of buttons on the joystick.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getButtonCount)
---
---@return number buttons # The number of buttons available.
function Joystick:getButtonCount() end
---
---Gets the USB vendor ID, product ID, and product version numbers of joystick which consistent across operating systems.
---
---Can be used to show different icons, etc. for different gamepads.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getDeviceInfo)
---
---@return number vendorID # The USB vendor ID of the joystick.
---@return number productID # The USB product ID of the joystick.
---@return number productVersion # The product version of the joystick.
function Joystick:getDeviceInfo() end
---
---Gets a stable GUID unique to the type of the physical joystick which does not change over time. For example, all Sony Dualshock 3 controllers in OS X have the same GUID. The value is platform-dependent.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getGUID)
---
---@return string guid # The Joystick type's OS-dependent unique identifier.
function Joystick:getGUID() end
---
---Gets the direction of a virtual gamepad axis. If the Joystick isn't recognized as a gamepad or isn't connected, this function will always return 0.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getGamepadAxis)
---
---@param axis love.GamepadAxis # The virtual axis to be checked.
---@return number direction # Current value of the axis.
function Joystick:getGamepadAxis(axis) end
---
---Gets the button, axis or hat that a virtual gamepad input is bound to.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getGamepadMapping)
---
---@overload fun(self: love.Joystick, button: love.GamepadButton):love.JoystickInputType, number, love.JoystickHat
---@param axis love.GamepadAxis # The virtual gamepad axis to get the binding for.
---@return love.JoystickInputType inputtype # The type of input the virtual gamepad axis is bound to.
---@return number inputindex # The index of the Joystick's button, axis or hat that the virtual gamepad axis is bound to.
---@return love.JoystickHat hatdirection # The direction of the hat, if the virtual gamepad axis is bound to a hat. nil otherwise.
function Joystick:getGamepadMapping(axis) end
---
---Gets the full gamepad mapping string of this Joystick, or nil if it's not recognized as a gamepad.
---
---The mapping string contains binding information used to map the Joystick's buttons an axes to the standard gamepad layout, and can be used later with love.joystick.loadGamepadMappings.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getGamepadMappingString)
---
---@return string mappingstring # A string containing the Joystick's gamepad mappings, or nil if the Joystick is not recognized as a gamepad.
function Joystick:getGamepadMappingString() end
---
---Gets the direction of the Joystick's hat.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getHat)
---
---@param hat number # The index of the hat to be checked.
---@return love.JoystickHat direction # The direction the hat is pushed.
function Joystick:getHat(hat) end
---
---Gets the number of hats on the joystick.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getHatCount)
---
---@return number hats # How many hats the joystick has.
function Joystick:getHatCount() end
---
---Gets the joystick's unique identifier. The identifier will remain the same for the life of the game, even when the Joystick is disconnected and reconnected, but it '''will''' change when the game is re-launched.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getID)
---
---@return number id # The Joystick's unique identifier. Remains the same as long as the game is running.
---@return number instanceid # Unique instance identifier. Changes every time the Joystick is reconnected. nil if the Joystick is not connected.
function Joystick:getID() end
---
---Gets the name of the joystick.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getName)
---
---@return string name # The name of the joystick.
function Joystick:getName() end
---
---Gets the current vibration motor strengths on a Joystick with rumble support.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:getVibration)
---
---@return number left # Current strength of the left vibration motor on the Joystick.
---@return number right # Current strength of the right vibration motor on the Joystick.
function Joystick:getVibration() end
---
---Gets whether the Joystick is connected.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:isConnected)
---
---@return boolean connected # True if the Joystick is currently connected, false otherwise.
function Joystick:isConnected() end
---
---Checks if a button on the Joystick is pressed.
---
---LÖVE 0.9.0 had a bug which required the button indices passed to Joystick:isDown to be 0-based instead of 1-based, for example button 1 would be 0 for this function. It was fixed in 0.9.1.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:isDown)
---
---@param buttonN number # The index of a button to check.
---@return boolean anyDown # True if any supplied button is down, false if not.
function Joystick:isDown(buttonN) end
---
---Gets whether the Joystick is recognized as a gamepad. If this is the case, the Joystick's buttons and axes can be used in a standardized manner across different operating systems and joystick models via Joystick:getGamepadAxis, Joystick:isGamepadDown, love.gamepadpressed, and related functions.
---
---LÖVE automatically recognizes most popular controllers with a similar layout to the Xbox 360 controller as gamepads, but you can add more with love.joystick.setGamepadMapping.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:isGamepad)
---
---@return boolean isgamepad # True if the Joystick is recognized as a gamepad, false otherwise.
function Joystick:isGamepad() end
---
---Checks if a virtual gamepad button on the Joystick is pressed. If the Joystick is not recognized as a Gamepad or isn't connected, then this function will always return false.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:isGamepadDown)
---
---@param buttonN love.GamepadButton # The gamepad button to check.
---@return boolean anyDown # True if any supplied button is down, false if not.
function Joystick:isGamepadDown(buttonN) end
---
---Gets whether the Joystick supports vibration.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:isVibrationSupported)
---
---@return boolean supported # True if rumble / force feedback vibration is supported on this Joystick, false if not.
function Joystick:isVibrationSupported() end
---
---Sets the vibration motor speeds on a Joystick with rumble support. Most common gamepads have this functionality, although not all drivers give proper support. Use Joystick:isVibrationSupported to check.
---
---
---[Open in Browser](https://love2d.org/wiki/Joystick:setVibration)
---
---@overload fun(self: love.Joystick):boolean
---@overload fun(self: love.Joystick, left: number, right: number, duration?: number):boolean
---@param left number # Strength of the left vibration motor on the Joystick. Must be in the range of 1.
---@param right number # Strength of the right vibration motor on the Joystick. Must be in the range of 1.
---@return boolean success # True if the vibration was successfully applied, false if not.
function Joystick:setVibration(left, right) end
---
---Virtual gamepad axes.
---
---
---[Open in Browser](https://love2d.org/wiki/GamepadAxis)
---
---@alias love.GamepadAxis
---
---The x-axis of the left thumbstick.
---
---| "leftx"
---
---The y-axis of the left thumbstick.
---
---| "lefty"
---
---The x-axis of the right thumbstick.
---
---| "rightx"
---
---The y-axis of the right thumbstick.
---
---| "righty"
---
---Left analog trigger.
---
---| "triggerleft"
---
---Right analog trigger.
---
---| "triggerright"
---
---Virtual gamepad buttons.
---
---
---[Open in Browser](https://love2d.org/wiki/GamepadButton)
---
---@alias love.GamepadButton
---
---Bottom face button (A).
---
---| "a"
---
---Right face button (B).
---
---| "b"
---
---Left face button (X).
---
---| "x"
---
---Top face button (Y).
---
---| "y"
---
---Back button.
---
---| "back"
---
---Guide button.
---
---| "guide"
---
---Start button.
---
---| "start"
---
---Left stick click button.
---
---| "leftstick"
---
---Right stick click button.
---
---| "rightstick"
---
---Left bumper.
---
---| "leftshoulder"
---
---Right bumper.
---
---| "rightshoulder"
---
---D-pad up.
---
---| "dpup"
---
---D-pad down.
---
---| "dpdown"
---
---D-pad left.
---
---| "dpleft"
---
---D-pad right.
---
---| "dpright"
---
---Joystick hat positions.
---
---
---[Open in Browser](https://love2d.org/wiki/JoystickHat)
---
---@alias love.JoystickHat
---
---Centered
---
---| "c"
---
---Down
---
---| "d"
---
---Left
---
---| "l"
---
---Left+Down
---
---| "ld"
---
---Left+Up
---
---| "lu"
---
---Right
---
---| "r"
---
---Right+Down
---
---| "rd"
---
---Right+Up
---
---| "ru"
---
---Up
---
---| "u"
---
---Types of Joystick inputs.
---
---
---[Open in Browser](https://love2d.org/wiki/JoystickInputType)
---
---@alias love.JoystickInputType
---
---Analog axis.
---
---| "axis"
---
---Button.
---
---| "button"
---
---8-direction hat value.
---
---| "hat"
This diff is collapsed.
This diff is collapsed.
---@meta
---
---Provides an interface to the user's mouse.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse)
---
---@class love.mouse
love.mouse = {}
---
---Gets the current Cursor.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.getCursor)
---
---@return love.Cursor cursor # The current cursor, or nil if no cursor is set.
function love.mouse.getCursor() end
---
---Returns the current position of the mouse.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.getPosition)
---
---@return number x # The position of the mouse along the x-axis.
---@return number y # The position of the mouse along the y-axis.
function love.mouse.getPosition() end
---
---Gets whether relative mode is enabled for the mouse.
---
---If relative mode is enabled, the cursor is hidden and doesn't move when the mouse does, but relative mouse motion events are still generated via love.mousemoved. This lets the mouse move in any direction indefinitely without the cursor getting stuck at the edges of the screen.
---
---The reported position of the mouse is not updated while relative mode is enabled, even when relative mouse motion events are generated.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.getRelativeMode)
---
---@return boolean enabled # True if relative mode is enabled, false if it's disabled.
function love.mouse.getRelativeMode() end
---
---Gets a Cursor object representing a system-native hardware cursor.
---
---Hardware cursors are framerate-independent and work the same way as normal operating system cursors. Unlike drawing an image at the mouse's current coordinates, hardware cursors never have visible lag between when the mouse is moved and when the cursor position updates, even at low framerates.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.getSystemCursor)
---
---@param ctype love.CursorType # The type of system cursor to get.
---@return love.Cursor cursor # The Cursor object representing the system cursor type.
function love.mouse.getSystemCursor(ctype) end
---
---Returns the current x-position of the mouse.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.getX)
---
---@return number x # The position of the mouse along the x-axis.
function love.mouse.getX() end
---
---Returns the current y-position of the mouse.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.getY)
---
---@return number y # The position of the mouse along the y-axis.
function love.mouse.getY() end
---
---Gets whether cursor functionality is supported.
---
---If it isn't supported, calling love.mouse.newCursor and love.mouse.getSystemCursor will cause an error. Mobile devices do not support cursors.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.isCursorSupported)
---
---@return boolean supported # Whether the system has cursor functionality.
function love.mouse.isCursorSupported() end
---
---Checks whether a certain mouse button is down.
---
---This function does not detect mouse wheel scrolling; you must use the love.wheelmoved (or love.mousepressed in version 0.9.2 and older) callback for that.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.isDown)
---
---@param button number # The index of a button to check. 1 is the primary mouse button, 2 is the secondary mouse button and 3 is the middle button. Further buttons are mouse dependant.
---@vararg number # Additional button numbers to check.
---@return boolean down # True if any specified button is down.
function love.mouse.isDown(button, ...) end
---
---Checks if the mouse is grabbed.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.isGrabbed)
---
---@return boolean grabbed # True if the cursor is grabbed, false if it is not.
function love.mouse.isGrabbed() end
---
---Checks if the cursor is visible.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.isVisible)
---
---@return boolean visible # True if the cursor to visible, false if the cursor is hidden.
function love.mouse.isVisible() end
---
---Creates a new hardware Cursor object from an image file or ImageData.
---
---Hardware cursors are framerate-independent and work the same way as normal operating system cursors. Unlike drawing an image at the mouse's current coordinates, hardware cursors never have visible lag between when the mouse is moved and when the cursor position updates, even at low framerates.
---
---The hot spot is the point the operating system uses to determine what was clicked and at what position the mouse cursor is. For example, the normal arrow pointer normally has its hot spot at the top left of the image, but a crosshair cursor might have it in the middle.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.newCursor)
---
---@overload fun(filename: string, hotx?: number, hoty?: number):love.Cursor
---@overload fun(fileData: love.FileData, hotx?: number, hoty?: number):love.Cursor
---@param imageData love.ImageData # The ImageData to use for the new Cursor.
---@param hotx? number # The x-coordinate in the ImageData of the cursor's hot spot.
---@param hoty? number # The y-coordinate in the ImageData of the cursor's hot spot.
---@return love.Cursor cursor # The new Cursor object.
function love.mouse.newCursor(imageData, hotx, hoty) end
---
---Sets the current mouse cursor.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.setCursor)
---
---@overload fun()
---@param cursor love.Cursor # The Cursor object to use as the current mouse cursor.
function love.mouse.setCursor(cursor) end
---
---Grabs the mouse and confines it to the window.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.setGrabbed)
---
---@param grab boolean # True to confine the mouse, false to let it leave the window.
function love.mouse.setGrabbed(grab) end
---
---Sets the current position of the mouse. Non-integer values are floored.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.setPosition)
---
---@param x number # The new position of the mouse along the x-axis.
---@param y number # The new position of the mouse along the y-axis.
function love.mouse.setPosition(x, y) end
---
---Sets whether relative mode is enabled for the mouse.
---
---When relative mode is enabled, the cursor is hidden and doesn't move when the mouse does, but relative mouse motion events are still generated via love.mousemoved. This lets the mouse move in any direction indefinitely without the cursor getting stuck at the edges of the screen.
---
---The reported position of the mouse may not be updated while relative mode is enabled, even when relative mouse motion events are generated.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.setRelativeMode)
---
---@param enable boolean # True to enable relative mode, false to disable it.
function love.mouse.setRelativeMode(enable) end
---
---Sets the current visibility of the cursor.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.setVisible)
---
---@param visible boolean # True to set the cursor to visible, false to hide the cursor.
function love.mouse.setVisible(visible) end
---
---Sets the current X position of the mouse.
---
---Non-integer values are floored.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.setX)
---
---@param x number # The new position of the mouse along the x-axis.
function love.mouse.setX(x) end
---
---Sets the current Y position of the mouse.
---
---Non-integer values are floored.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse.setY)
---
---@param y number # The new position of the mouse along the y-axis.
function love.mouse.setY(y) end
---
---Represents a hardware cursor.
---
---
---[Open in Browser](https://love2d.org/wiki/love.mouse)
---
---@class love.Cursor: love.Object
local Cursor = {}
---
---Gets the type of the Cursor.
---
---
---[Open in Browser](https://love2d.org/wiki/Cursor:getType)
---
---@return love.CursorType ctype # The type of the Cursor.
function Cursor:getType() end
---
---Types of hardware cursors.
---
---
---[Open in Browser](https://love2d.org/wiki/CursorType)
---
---@alias love.CursorType
---
---The cursor is using a custom image.
---
---| "image"
---
---An arrow pointer.
---
---| "arrow"
---
---An I-beam, normally used when mousing over editable or selectable text.
---
---| "ibeam"
---
---Wait graphic.
---
---| "wait"
---
---Small wait cursor with an arrow pointer.
---
---| "waitarrow"
---
---Crosshair symbol.
---
---| "crosshair"
---
---Double arrow pointing to the top-left and bottom-right.
---
---| "sizenwse"
---
---Double arrow pointing to the top-right and bottom-left.
---
---| "sizenesw"
---
---Double arrow pointing left and right.
---
---| "sizewe"
---
---Double arrow pointing up and down.
---
---| "sizens"
---
---Four-pointed arrow pointing up, down, left, and right.
---
---| "sizeall"
---
---Slashed circle or crossbones.
---
---| "no"
---
---Hand symbol.
---
---| "hand"
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment