main function
stringlengths
8
40
chunks
stringlengths
41
8.32k
repo_name
stringclasses
1 value
Channel:push
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
love2d-community.github.io/love-api
Channel:supply
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,...
love2d-community.github.io/love-api
Thread:getError
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.
love2d-community.github.io/love-api
Thread:isRunning
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.
love2d-community.github.io/love-api
Thread:start
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.
love2d-community.github.io/love-api
Thread:wait
Thread:wait Wait for a thread to finish. This call will block until the thread finishes. Thread:wait()
love2d-community.github.io/love-api
love.timer.getAverageDelta
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.
love2d-community.github.io/love-api
love.timer.getDelta
love.timer.getDelta Returns the time between the last two frames. dt = love.timer.getDelta() dt number The time passed (in seconds).
love2d-community.github.io/love-api
love.timer.getFPS
love.timer.getFPS Returns the current frames per second. fps = love.timer.getFPS() fps number The current FPS.
love2d-community.github.io/love-api
love.timer.getTime
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 microsecon...
love2d-community.github.io/love-api
love.timer.sleep
love.timer.sleep Pauses the current thread for the specified amount of time. love.timer.sleep( s ) s number Seconds to sleep for.
love2d-community.github.io/love-api
love.timer.step
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).
love2d-community.github.io/love-api
love.touch.getPosition
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 tou...
love2d-community.github.io/love-api
love.touch.getPressure
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 to...
love2d-community.github.io/love-api
love.touch.getTouches
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.
love2d-community.github.io/love-api
love.video.newVideoStream
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 Vid...
love2d-community.github.io/love-api
VideoStream:getFilename
VideoStream:getFilename Gets the filename of the VideoStream. filename = VideoStream:getFilename() filename string The filename of the VideoStream
love2d-community.github.io/love-api
VideoStream:isPlaying
VideoStream:isPlaying Gets whether the VideoStream is playing. playing = VideoStream:isPlaying() playing boolean Whether the VideoStream is playing.
love2d-community.github.io/love-api
VideoStream:pause
VideoStream:pause Pauses the VideoStream. VideoStream:pause()
love2d-community.github.io/love-api
VideoStream:play
VideoStream:play Plays the VideoStream. VideoStream:play()
love2d-community.github.io/love-api
VideoStream:rewind
VideoStream:rewind Rewinds the VideoStream. Synonym to VideoStream:seek(0). VideoStream:rewind()
love2d-community.github.io/love-api
VideoStream:seek
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.
love2d-community.github.io/love-api
VideoStream:tell
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.
love2d-community.github.io/love-api
love.window.close
love.window.close Closes the window. It can be reopened with love.window.setMode. love.window.close()
love2d-community.github.io/love-api
love.window.fromPixels
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 800x60...
love2d-community.github.io/love-api
love.window.getDPIScale
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 win...
love2d-community.github.io/love-api
love.window.getDesktopDimensions
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.
love2d-community.github.io/love-api
love.window.getDisplayCount
love.window.getDisplayCount Gets the number of connected monitors. count = love.window.getDisplayCount() count number The number of currently connected displays.
love2d-community.github.io/love-api
love.window.getDisplayName
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.
love2d-community.github.io/love-api
love.window.getDisplayOrientation
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.
love2d-community.github.io/love-api
love.window.getFullscreen
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.
love2d-community.github.io/love-api
love.window.getFullscreenModes
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 Windo...
love2d-community.github.io/love-api
love.window.getIcon
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.
love2d-community.github.io/love-api
love.window.getMode
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 ...
love2d-community.github.io/love-api
love.window.getPosition
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 nu...
love2d-community.github.io/love-api
love.window.getSafeArea
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 ar...
love2d-community.github.io/love-api
love.window.getTitle
love.window.getTitle Gets the window title. title = love.window.getTitle() title string The current window title.
love2d-community.github.io/love-api
love.window.getVSync
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.
love2d-community.github.io/love-api
love.window.hasFocus
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.
love2d-community.github.io/love-api
love.window.hasMouseFocus
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.
love2d-community.github.io/love-api
love.window.isDisplaySleepEnabled
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() e...
love2d-community.github.io/love-api
love.window.isMaximized
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 ...
love2d-community.github.io/love-api
love.window.isMinimized
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.
love2d-community.github.io/love-api
love.window.isOpen
love.window.isOpen Checks if the window is open. open = love.window.isOpen() open boolean True if the window is open, false otherwise.
love2d-community.github.io/love-api
love.window.isVisible
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.
love2d-community.github.io/love-api
love.window.maximize
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()
love2d-community.github.io/love-api
love.window.minimize
love.window.minimize Minimizes the window to the system's task bar / dock. love.window.minimize()
love2d-community.github.io/love-api
love.window.requestAttention
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 wi...
love2d-community.github.io/love-api
love.window.restore
love.window.restore Restores the size and position of the window if it was minimized or maximized. love.window.restore()
love2d-community.github.io/love-api
love.window.setDisplaySleepEnabled
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 ) e...
love2d-community.github.io/love-api
love.window.setFullscreen
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 boolea...
love2d-community.github.io/love-api
love.window.setIcon
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.
love2d-community.github.io/love-api
love.window.setMode
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...
love2d-community.github.io/love-api
love.window.setPosition
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 T...
love2d-community.github.io/love-api
love.window.setTitle
love.window.setTitle Sets the window title. love.window.setTitle( title ) title string The new window title.
love2d-community.github.io/love-api
love.window.setVSync
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.
love2d-community.github.io/love-api
love.window.showMessageBox
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 ('inf...
love2d-community.github.io/love-api
love.window.toPixels
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 ...
love2d-community.github.io/love-api
love.window.updateMode
love.window.updateMode Sets the display mode and properties of the window, without modifying unspecified properties. If width or height is 0, updateMode will use the width and height of the desktop. Changing the display mode may have side effects: for example, canvases will be cleared. Make sure to save the contents ...
love2d-community.github.io/love-api