Nocare3/love2dapi_chunks huggingface dataset:
love.thread.newThread
Creates a new Thread from a filename, string or FileData object containing Lua code.
thread = love.thread.newThread( filename )
filename string The name of the Lua file to use as the source.
thread Thread A new Thread that has yet to be started.
thread = love.thread.newThread( fileData )
fileData FileData The FileData containing the Lua code to use as the source.
thread Thread A new Thread that has yet to be started.
thread = love.thread.newThread( codestring )
codestring string A string containing the Lua code to use as the source. It needs to either be at least 1024 characters long, or contain at least one newline.
thread Thread A new Thread that has yet to be started.
Channel:demand
Retrieves the value of a Channel message and removes it from the message queue.

It waits until a message is in the queue then returns the message value.
value = Channel:demand()
value Variant The contents of the message.
value = Channel:demand( timeout )
timeout number The maximum amount of time to wait.
value Variant The contents of the message or nil if the timeout expired.
Channel:getCount
Retrieves the number of messages in the thread Channel queue.
count = Channel:getCount()
count number The number of messages in the queue.
Channel:hasRead
Gets whether a pushed value has been popped or otherwise removed from the Channel.
hasread = Channel:hasRead( id )
id number An id value previously returned by Channel:push.
hasread boolean Whether the value represented by the id has been removed from the Channel via Channel:pop, Channel:demand, or Channel:clear.
Channel:peek
Retrieves the value of a Channel message, but leaves it in the queue.

It returns nil if there's no message in the queue.
value = Channel:peek()
value Variant The contents of the message.
Channel:performAtomic
Executes the specified function atomically with respect to this Channel.

Calling multiple methods in a row on the same Channel is often useful. However if multiple Threads are calling this Channel's methods at the same time, the different calls on each Thread might end up interleaved (e.g. one or more of the second thread's calls may happen in between the first thread's calls.)

This method avoids that issue by making sure the Thread calling the method has exclusive access to the Channel until the specified function has returned.
ret1, ... = Channel:performAtomic( func, ... )
func function The function to call, the form of function(channel, arg1, arg2, ...) end. The Channel is passed as the first argument to the function when it is called.
... any Additional arguments that the given function will receive when it is called.
ret1 any The first return value of the given function (if any.)
... any Any other return values.
Channel:pop
Retrieves the value of a Channel message and removes it from the message queue.

It returns nil if there are no messages in the queue.
value = Channel:pop()
value Variant The contents of the message.
Channel:push
Send a message to the thread Channel.

See Variant for the list of supported types.
id = Channel:push( value )
value Variant The contents of the message.
id number Identifier which can be supplied to Channel:hasRead
Channel:supply
Send a message to the thread Channel and wait for a thread to accept it.

See Variant for the list of supported types.
success = Channel:supply( value )
value Variant The contents of the message.
success boolean Whether the message was successfully supplied (always true).
success = Channel:supply( value, timeout )
value Variant The contents of the message.
timeout number The maximum amount of time to wait.
success boolean Whether the message was successfully supplied before the timeout expired.
Thread:getError
Retrieves the error string from the thread if it produced an error.
err = Thread:getError()
err string The error message, or nil if the Thread has not caused an error.
Thread:isRunning
Returns whether the thread is currently running.

Threads which are not running can be (re)started with Thread:start.
value = Thread:isRunning()
value boolean True if the thread is running, false otherwise.
Thread:start
Starts the thread.

Beginning with version 0.9.0, threads can be restarted after they have completed their execution.
Thread:start()
Thread:start( ... )
... Variant A string, number, boolean, LÖVE object, or simple table.
Thread:wait
Wait for a thread to finish.

This call will block until the thread finishes.
Thread:wait()
love.timer.getAverageDelta
Returns the average delta time (seconds per frame) over the last second.
delta = love.timer.getAverageDelta()
delta number The average delta time over the last second.
love.timer.getDelta
Returns the time between the last two frames.
dt = love.timer.getDelta()
dt number The time passed (in seconds).
love.timer.getFPS
Returns the current frames per second.
fps = love.timer.getFPS()
fps number The current FPS.
love.timer.getTime
Returns the value of a timer with an unspecified starting time.

This function should only be used to calculate differences between points in time, as the starting time of the timer is unknown.
time = love.timer.getTime()
time number The time in seconds. Given as a decimal, accurate to the microsecond.
love.timer.sleep
Pauses the current thread for the specified amount of time.
love.timer.sleep( s )
s number Seconds to sleep for.
love.timer.step
Measures the time between two frames.

Calling this changes the return value of love.timer.getDelta.
dt = love.timer.step()
dt number The time passed (in seconds).
love.touch.getPosition
Gets the current position of the specified touch-press, in pixels.
x, y = love.touch.getPosition( id )
id light userdata The identifier of the touch-press. Use love.touch.getTouches, love.touchpressed, or love.touchmoved to obtain touch id values.
x number The position along the x-axis of the touch-press inside the window, in pixels.
y number The position along the y-axis of the touch-press inside the window, in pixels.
love.touch.getPressure
Gets the current pressure of the specified touch-press.
pressure = love.touch.getPressure( id )
id light userdata The identifier of the touch-press. Use love.touch.getTouches, love.touchpressed, or love.touchmoved to obtain touch id values.
pressure number The pressure of the touch-press. Most touch screens aren't pressure sensitive, in which case the pressure will be 1.
love.touch.getTouches
Gets a list of all active touch-presses.
touches = love.touch.getTouches()
touches table A list of active touch-press id values, which can be used with love.touch.getPosition.
love.video.newVideoStream
Creates a new VideoStream. Currently only Ogg Theora video files are supported. VideoStreams can't draw videos, see love.graphics.newVideo for that.
videostream = love.video.newVideoStream( filename )
filename string The file path to the Ogg Theora video file.
videostream VideoStream A new VideoStream.
videostream = love.video.newVideoStream( file )
file File The File object containing the Ogg Theora video.
videostream VideoStream A new VideoStream.
VideoStream:getFilename
Gets the filename of the VideoStream.
filename = VideoStream:getFilename()
filename string The filename of the VideoStream
VideoStream:isPlaying
Gets whether the VideoStream is playing.
playing = VideoStream:isPlaying()
playing boolean Whether the VideoStream is playing.
VideoStream:rewind
Rewinds the VideoStream. Synonym to VideoStream:seek(0).
VideoStream:rewind()
VideoStream:seek
Sets the current playback position of the VideoStream.
VideoStream:seek( offset )
offset number The time in seconds since the beginning of the VideoStream.
VideoStream:tell
Gets the current playback position of the VideoStream.
seconds = VideoStream:tell()
seconds number The number of seconds sionce the beginning of the VideoStream.
love.window.close
Closes the window. It can be reopened with love.window.setMode.
love.window.close()
love.window.fromPixels
Converts a number from pixels to density-independent units.

The pixel density inside the window might be greater (or smaller) than the 'size' of the window. For example on a retina screen in Mac OS X with the highdpi window flag enabled, the window may take up the same physical size as an 800x600 window, but the area inside the window uses 1600x1200 pixels. love.window.fromPixels(1600) would return 800 in that case.

This function converts coordinates from pixels to the size users are expecting them to display at onscreen. love.window.toPixels does the opposite. The highdpi window flag must be enabled to use the full pixel density of a Retina screen on Mac OS X and iOS. The flag currently does nothing on Windows and Linux, and on Android it is effectively always enabled.

Most LÖVE functions return values and expect arguments in terms of pixels rather than density-independent units.
value = love.window.fromPixels( pixelvalue )
pixelvalue number A number in pixels to convert to density-independent units.
value number The converted number, in density-independent units.
x, y = love.window.fromPixels( px, py )
px number The x-axis value of a coordinate in pixels.
py number The y-axis value of a coordinate in pixels.
x number The converted x-axis value of the coordinate, in density-independent units.
y number The converted y-axis value of the coordinate, in density-independent units.
love.window.getDPIScale
Gets the DPI scale factor associated with the window.

The pixel density inside the window might be greater (or smaller) than the 'size' of the window. For example on a retina screen in Mac OS X with the highdpi window flag enabled, the window may take up the same physical size as an 800x600 window, but the area inside the window uses 1600x1200 pixels. love.window.getDPIScale() would return 2.0 in that case.

The love.window.fromPixels and love.window.toPixels functions can also be used to convert between units.

The highdpi window flag must be enabled to use the full pixel density of a Retina screen on Mac OS X and iOS. The flag currently does nothing on Windows and Linux, and on Android it is effectively always enabled.
scale = love.window.getDPIScale()
scale number The pixel scale factor associated with the window.
love.window.getDesktopDimensions
Gets the width and height of the desktop.
width, height = love.window.getDesktopDimensions( displayindex )
displayindex (1) number The index of the display, if multiple monitors are available.
width number The width of the desktop.
height number The height of the desktop.
love.window.getDisplayCount
Gets the number of connected monitors.
count = love.window.getDisplayCount()
count number The number of currently connected displays.
love.window.getDisplayName
Gets the name of a display.
name = love.window.getDisplayName( displayindex )
displayindex (1) number The index of the display to get the name of.
name string The name of the specified display.
love.window.getDisplayOrientation
Gets current device display orientation.
orientation = love.window.getDisplayOrientation( displayindex )
displayindex (nil) number Display index to get its display orientation, or nil for default display index.
orientation DisplayOrientation Current device display orientation.
love.window.getFullscreen
Gets whether the window is fullscreen.
fullscreen, fstype = love.window.getFullscreen()
fullscreen boolean True if the window is fullscreen, false otherwise.
fstype FullscreenType The type of fullscreen mode used.
love.window.getFullscreenModes
Gets a list of supported fullscreen modes.
modes = love.window.getFullscreenModes( displayindex )
displayindex (1) number The index of the display, if multiple monitors are available.
modes table A table of width/height pairs. (Note that this may not be in order.)
modes.width number Window fullscreen width.
modes.height number Window fullscreen height.
love.window.getIcon
Gets the window icon.
imagedata = love.window.getIcon()
imagedata ImageData The window icon imagedata, or nil if no icon has been set with love.window.setIcon.
love.window.getMode
Gets the display mode and properties of the window.
width, height, flags = love.window.getMode()
width number Window width.
height number Window height.
flags table Table with the window properties:
flags.fullscreen boolean Fullscreen (true), or windowed (false).
flags.fullscreentype FullscreenType The type of fullscreen mode used.
flags.vsync boolean True if the graphics framerate is synchronized with the monitor's refresh rate, false otherwise.
flags.msaa number The number of antialiasing samples used (0 if MSAA is disabled).
flags.resizable boolean True if the window is resizable in windowed mode, false otherwise.
flags.borderless boolean True if the window is borderless in windowed mode, false otherwise.
flags.centered boolean True if the window is centered in windowed mode, false otherwise.
flags.display number The index of the display the window is currently in, if multiple monitors are available.
flags.minwidth number The minimum width of the window, if it's resizable.
flags.minheight number The minimum height of the window, if it's resizable.
flags.highdpi boolean True if high-dpi mode is allowed on Retina displays in OS X. Does nothing on non-Retina displays.
flags.refreshrate number The refresh rate of the screen's current display mode, in Hz. May be 0 if the value can't be determined.
flags.x number The x-coordinate of the window's position in its current display.
flags.y number The y-coordinate of the window's position in its current display.
flags.srgb boolean Removed in 0.10.0 (use love.graphics.isGammaCorrect instead). True if sRGB gamma correction is applied when drawing to the screen.
love.window.getPosition
Gets the position of the window on the screen.

The window position is in the coordinate space of the display it is currently in.
x, y, displayindex = love.window.getPosition()
x number The x-coordinate of the window's position.
y number The y-coordinate of the window's position.
displayindex number The index of the display that the window is in.
love.window.getSafeArea
Gets area inside the window which is known to be unobstructed by a system title bar, the iPhone X notch, etc. Useful for making sure UI elements can be seen by the user.
x, y, w, h = love.window.getSafeArea()
x number Starting position of safe area (x-axis).
y number Starting position of safe area (y-axis).
w number Width of safe area.
h number Height of safe area.
love.window.getTitle
Gets the window title.
title = love.window.getTitle()
title string The current window title.
love.window.getVSync
Gets current vertical synchronization (vsync).
vsync = love.window.getVSync()
vsync number Current vsync status. 1 if enabled, 0 if disabled, and -1 for adaptive vsync.
love.window.hasFocus
Checks if the game window has keyboard focus.
focus = love.window.hasFocus()
focus boolean True if the window has the focus or false if not.
love.window.hasMouseFocus
Checks if the game window has mouse focus.
focus = love.window.hasMouseFocus()
focus boolean True if the window has mouse focus or false if not.
love.window.isDisplaySleepEnabled
Gets whether the display is allowed to sleep while the program is running.

Display sleep is disabled by default. Some types of input (e.g. joystick button presses) might not prevent the display from sleeping, if display sleep is allowed.
enabled = love.window.isDisplaySleepEnabled()
enabled boolean True if system display sleep is enabled / allowed, false otherwise.
love.window.isMaximized
Gets whether the Window is currently maximized.

The window can be maximized if it is not fullscreen and is resizable, and either the user has pressed the window's Maximize button or love.window.maximize has been called.
maximized = love.window.isMaximized()
maximized boolean True if the window is currently maximized in windowed mode, false otherwise.
love.window.isMinimized
Gets whether the Window is currently minimized.
minimized = love.window.isMinimized()
minimized boolean True if the window is currently minimized, false otherwise.
love.window.isOpen
Checks if the window is open.
open = love.window.isOpen()
open boolean True if the window is open, false otherwise.
love.window.isVisible
Checks if the game window is visible.

The window is considered visible if it's not minimized and the program isn't hidden.
visible = love.window.isVisible()
visible boolean True if the window is visible or false if not.
love.window.maximize
Makes the window as large as possible.

This function has no effect if the window isn't resizable, since it essentially programmatically presses the window's 'maximize' button.
love.window.maximize()
love.window.minimize
Minimizes the window to the system's task bar / dock.
love.window.minimize()
love.window.requestAttention
Causes the window to request the attention of the user if it is not in the foreground.

In Windows the taskbar icon will flash, and in OS X the dock icon will bounce.
love.window.requestAttention( continuous )
continuous (false) boolean Whether to continuously request attention until the window becomes active, or to do it only once.
love.window.restore
Restores the size and position of the window if it was minimized or maximized.
love.window.restore()
love.window.setDisplaySleepEnabled
Sets whether the display is allowed to sleep while the program is running.

Display sleep is disabled by default. Some types of input (e.g. joystick button presses) might not prevent the display from sleeping, if display sleep is allowed.
love.window.setDisplaySleepEnabled( enable )
enable boolean True to enable system display sleep, false to disable it.
love.window.setFullscreen
Enters or exits fullscreen. The display to use when entering fullscreen is chosen based on which display the window is currently in, if multiple monitors are connected.
success = love.window.setFullscreen( fullscreen )
fullscreen boolean Whether to enter or exit fullscreen mode.
success boolean True if an attempt to enter fullscreen was successful, false otherwise.
success = love.window.setFullscreen( fullscreen, fstype )
fullscreen boolean Whether to enter or exit fullscreen mode.
fstype FullscreenType The type of fullscreen mode to use.
success boolean True if an attempt to enter fullscreen was successful, false otherwise.
love.window.setIcon
Sets the window icon until the game is quit. Not all operating systems support very large icon images.
success = love.window.setIcon( imagedata )
imagedata ImageData The window icon image.
success boolean Whether the icon has been set successfully.
love.window.setMode
Sets the display mode and properties of the window.

If width or height is 0, setMode will use the width and height of the desktop.

Changing the display mode may have side effects: for example, canvases will be cleared and values sent to shaders with canvases beforehand or re-draw to them afterward if you need to.
success = love.window.setMode( width, height, flags )
width number Display width.
height number Display height.
flags table The flags table with the options:
flags.fullscreen (false) boolean Fullscreen (true), or windowed (false).
flags.fullscreentype ('desktop') FullscreenType The type of fullscreen to use. This defaults to 'normal' in 0.9.0 through 0.9.2 and to 'desktop' in 0.10.0 and older.
flags.vsync (true) boolean True if LÖVE should wait for vsync, false otherwise.
flags.msaa (0) number The number of antialiasing samples.
flags.stencil (true) boolean Whether a stencil buffer should be allocated. If true, the stencil buffer will have 8 bits.
flags.depth (0) number The number of bits in the depth buffer.
flags.resizable (false) boolean True if the window should be resizable in windowed mode, false otherwise.
flags.borderless (false) boolean True if the window should be borderless in windowed mode, false otherwise.
flags.centered (true) boolean True if the window should be centered in windowed mode, false otherwise.
flags.display (1) number The index of the display to show the window in, if multiple monitors are available.
flags.minwidth (1) number The minimum width of the window, if it's resizable. Cannot be less than 1.
flags.minheight (1) number The minimum height of the window, if it's resizable. Cannot be less than 1.
flags.highdpi (false) boolean True if high-dpi mode should be used on Retina displays in macOS and iOS. Does nothing on non-Retina displays.
flags.x (nil) number The x-coordinate of the window's position in the specified display.
flags.y (nil) number The y-coordinate of the window's position in the specified display.
flags.usedpiscale (true) boolean Disables automatic DPI scaling when false.
flags.srgb (false) boolean Removed in 0.10.0 (set t.gammacorrect in conf.lua instead). True if sRGB gamma correction should be applied when drawing to the screen.
success boolean True if successful, false otherwise.
love.window.setPosition
Sets the position of the window on the screen.

The window position is in the coordinate space of the specified display.
love.window.setPosition( x, y, displayindex )
x number The x-coordinate of the window's position.
y number The y-coordinate of the window's position.
displayindex (1) number The index of the display that the new window position is relative to.
love.window.setTitle
Sets the window title.
love.window.setTitle( title )
title string The new window title.
love.window.setVSync
Sets vertical synchronization mode.
love.window.setVSync( vsync )
vsync number VSync number: 1 to enable, 0 to disable, and -1 for adaptive vsync.
love.window.showMessageBox
Displays a message box dialog above the love window. The message box contains a title, optional text, and buttons.
success = love.window.showMessageBox( title, message, type, attachtowindow )
title string The title of the message box.
message string The text inside the message box.
type ('info') MessageBoxType The type of the message box.
attachtowindow (true) boolean Whether the message box should be attached to the love window or free-floating.
success boolean Whether the message box was successfully displayed.
pressedbutton = love.window.showMessageBox( title, message, buttonlist, type, attachtowindow )
title string The title of the message box.
message string The text inside the message box.
buttonlist table A table containing a list of button names to show. The table can also contain the fields enterbutton and escapebutton, which should be the index of the default button to use when the user presses 'enter' or 'escape', respectively.
type ('info') MessageBoxType The type of the message box.
attachtowindow (true) boolean Whether the message box should be attached to the love window or free-floating.
pressedbutton number The index of the button pressed by the user. May be 0 if the message box dialog was closed without pressing a button.
love.window.toPixels
Converts a number from density-independent units to pixels.

The pixel density inside the window might be greater (or smaller) than the 'size' of the window. For example on a retina screen in Mac OS X with the highdpi window flag enabled, the window may take up the same physical size as an 800x600 window, but the area inside the window uses 1600x1200 pixels. love.window.toPixels(800) would return 1600 in that case.

This is used to convert coordinates from the size users are expecting them to display at onscreen to pixels. love.window.fromPixels does the opposite. The highdpi window flag must be enabled to use the full pixel density of a Retina screen on Mac OS X and iOS. The flag currently does nothing on Windows and Linux, and on Android it is effectively always enabled.

Most LÖVE functions return values and expect arguments in terms of pixels rather than density-independent units.
pixelvalue = love.window.toPixels( value )
value number A number in density-independent units to convert to pixels.
pixelvalue number The converted number, in pixels.
px, py = love.window.toPixels( x, y )
x number The x-axis value of a coordinate in density-independent units to convert to pixels.
y number The y-axis value of a coordinate in density-independent units to convert to pixels.
px number The converted x-axis value of the coordinate, in pixels.
py number The converted y-axis value of the coordinate, in pixels.