love.directorydropped

Callback function triggered when a directory is dragged and dropped onto the window.

love.directorydropped( path )

pathstringThe full platform-dependent path to the directory. It can be used as an argument to love.filesystem.mount, in order to gain read access to the directory with love.filesystem.

love.draw

Callback function used to draw on the screen every frame.

love.draw()

love.errorhandler

The error handler, used to display error messages.

love.errorhandler( msg )

msgstringThe error message.

love.filedropped

Callback function triggered when a file is dragged and dropped onto the window.

love.filedropped( file )

fileDroppedFileThe unopened File object representing the file that was dropped.

love.focus

Callback function triggered when window receives or loses focus.

love.focus( focus )

focusbooleanTrue if the window gains focus, false if it loses focus.

love.gamepadaxis

Called when a Joystick's virtual gamepad axis is moved.

love.gamepadaxis( joystick, axis, value )

joystickJoystickThe joystick object.
axisGamepadAxisThe virtual gamepad axis.
valuenumberThe new axis value.

love.gamepadpressed

Called when a Joystick's virtual gamepad button is pressed.

love.gamepadpressed( joystick, button )

joystickJoystickThe joystick object.
buttonGamepadButtonThe virtual gamepad button.

love.gamepadreleased

Called when a Joystick's virtual gamepad button is released.

love.gamepadreleased( joystick, button )

joystickJoystickThe joystick object.
buttonGamepadButtonThe virtual gamepad button.

love.joystickadded

Called when a Joystick is connected.

love.joystickadded( joystick )

joystickJoystickThe newly connected Joystick object.

love.joystickaxis

Called when a joystick axis moves.

love.joystickaxis( joystick, axis, value )

joystickJoystickThe joystick object.
axisnumberThe axis number.
valuenumberThe new axis value.

love.joystickhat

Called when a joystick hat direction changes.

love.joystickhat( joystick, hat, direction )

joystickJoystickThe joystick object.
hatnumberThe hat number.
directionJoystickHatThe new hat direction.

love.joystickpressed

Called when a joystick button is pressed.

love.joystickpressed( joystick, button )

joystickJoystickThe joystick object.
buttonnumberThe button number.

love.joystickreleased

Called when a joystick button is released.

love.joystickreleased( joystick, button )

joystickJoystickThe joystick object.
buttonnumberThe button number.

love.joystickremoved

Called when a Joystick is disconnected.

love.joystickremoved( joystick )

joystickJoystickThe now-disconnected Joystick object.

love.keypressed

Callback function triggered when a key is pressed.

love.keypressed( key, scancode, isrepeat )

keyKeyConstantCharacter of the pressed key.
scancodeScancodeThe scancode representing the pressed key.
isrepeatbooleanWhether this keypress event is a repeat. The delay between key repeats depends on the user's system settings.

love.keypressed( key, isrepeat )

keyKeyConstantCharacter of the key pressed.
isrepeatbooleanWhether this keypress event is a repeat. The delay between key repeats depends on the user's system settings.

Callback function triggered when a key is pressed.

love.keypressed( key, scancode, isrepeat )

keyKeyConstantCharacter of the pressed key.
scancodeScancodeThe scancode representing the pressed key.
isrepeatbooleanWhether this keypress event is a repeat. The delay between key repeats depends on the user's system settings.

love.keypressed( key, isrepeat )

keyKeyConstantCharacter of the key pressed.
isrepeatbooleanWhether this keypress event is a repeat. The delay between key repeats depends on the user's system settings.

love.keyreleased

Callback function triggered when a keyboard key is released.

love.keyreleased( key, scancode )

keyKeyConstantCharacter of the released key.
scancodeScancodeThe scancode representing the released key.

love.load

This function is called exactly once at the beginning of the game.

love.load( arg, unfilteredArg )

argtableCommand-line arguments given to the game.
unfilteredArgtableUnfiltered command-line arguments given to the executable (see #Notes).

love.lowmemory

Callback function triggered when the system is running out of memory on mobile devices.

Mobile operating systems may forcefully kill the game if it uses too much memory, so any non-critical resource should be removed if possible (by setting all variables referencing the resources to '''nil'''), when this event is triggered. Sounds and images in particular tend to use the most memory.

love.lowmemory()

love.mousefocus

Callback function triggered when window receives or loses mouse focus.

love.mousefocus( focus )

focusbooleanWhether the window has mouse focus or not.

love.mousemoved

Callback function triggered when the mouse is moved.

love.mousemoved( x, y, dx, dy, istouch )

xnumberThe mouse position on the x-axis.
ynumberThe mouse position on the y-axis.
dxnumberThe amount moved along the x-axis since the last time love.mousemoved was called.
dynumberThe amount moved along the y-axis since the last time love.mousemoved was called.
istouchbooleanTrue if the mouse button press originated from a touchscreen touch-press.

love.mousepressed

Callback function triggered when a mouse button is pressed.

love.mousepressed( x, y, button, istouch, presses )

xnumberMouse x position, in pixels.
ynumberMouse y position, in pixels.
buttonnumberThe button index that was pressed. 1 is the primary mouse button, 2 is the secondary mouse button and 3 is the middle button. Further buttons are mouse dependent.
istouchbooleanTrue if the mouse button press originated from a touchscreen touch-press.
pressesnumberThe number of presses in a short time frame and small area, used to simulate double, triple clicks

love.mousereleased

Callback function triggered when a mouse button is released.

love.mousereleased( x, y, button, istouch, presses )

xnumberMouse x position, in pixels.
ynumberMouse y position, in pixels.
buttonnumberThe button index that was released. 1 is the primary mouse button, 2 is the secondary mouse button and 3 is the middle button. Further buttons are mouse dependent.
istouchbooleanTrue if the mouse button release originated from a touchscreen touch-release.
pressesnumberThe number of presses in a short time frame and small area, used to simulate double, triple clicks

love.quit

Callback function triggered when the game is closed.

r = love.quit()

rbooleanAbort quitting. If true, do not close the game.

love.resize

Called when the window is resized, for example if the user resizes the window, or if love.window.setMode is called with an unsupported width or height in fullscreen and the window chooses the closest appropriate size.

love.resize( w, h )

wnumberThe new width.
hnumberThe new height.

love.run

The main function, containing the main loop. A sensible default is used when left out.

mainLoop = love.run()

mainLoopfunctionFunction which handlers one frame, including events and rendering when called.

love.textedited

Called when the candidate text for an IME (Input Method Editor) has changed.

The candidate text is not the final text that the user will eventually choose. Use love.textinput for that.

love.textedited( text, start, length )

textstringThe UTF-8 encoded unicode candidate text.
startnumberThe start cursor of the selected candidate text.
lengthnumberThe length of the selected candidate text. May be 0.

love.textinput

Called when text has been entered by the user. For example if shift-2 is pressed on an American keyboard layout, the text '@' will be generated.

love.textinput( text )

textstringThe UTF-8 encoded unicode text.

love.threaderror

Callback function triggered when a Thread encounters an error.

love.threaderror( thread, errorstr )

threadThreadThe thread which produced the error.
errorstrstringThe error message.

love.touchmoved

Callback function triggered when a touch press moves inside the touch screen.

love.touchmoved( id, x, y, dx, dy, pressure )

idlight userdataThe identifier for the touch press.
xnumberThe x-axis position of the touch inside the window, in pixels.
ynumberThe y-axis position of the touch inside the window, in pixels.
dxnumberThe x-axis movement of the touch inside the window, in pixels.
dynumberThe y-axis movement of the touch inside the window, in pixels.
pressurenumberThe amount of pressure being applied. Most touch screens aren't pressure sensitive, in which case the pressure will be 1.

love.touchpressed

Callback function triggered when the touch screen is touched.

love.touchpressed( id, x, y, dx, dy, pressure )

idlight userdataThe identifier for the touch press.
xnumberThe x-axis position of the touch press inside the window, in pixels.
ynumberThe y-axis position of the touch press inside the window, in pixels.
dxnumberThe x-axis movement of the touch press inside the window, in pixels. This should always be zero.
dynumberThe y-axis movement of the touch press inside the window, in pixels. This should always be zero.
pressurenumberThe amount of pressure being applied. Most touch screens aren't pressure sensitive, in which case the pressure will be 1.

love.touchreleased

Callback function triggered when the touch screen stops being touched.

love.touchreleased( id, x, y, dx, dy, pressure )

idlight userdataThe identifier for the touch press.
xnumberThe x-axis position of the touch inside the window, in pixels.
ynumberThe y-axis position of the touch inside the window, in pixels.
dxnumberThe x-axis movement of the touch inside the window, in pixels.
dynumberThe y-axis movement of the touch inside the window, in pixels.
pressurenumberThe amount of pressure being applied. Most touch screens aren't pressure sensitive, in which case the pressure will be 1.

love.update

Callback function used to update the state of the game every frame.

love.update( dt )

dtnumberTime since the last update in seconds.

love.visible

Callback function triggered when window is minimized/hidden or unminimized by the user.

love.visible( visible )

visiblebooleanTrue if the window is visible, false if it isn't.

love.wheelmoved

Callback function triggered when the mouse wheel is moved.

love.wheelmoved( x, y )

xnumberAmount of horizontal mouse wheel movement. Positive values indicate movement to the right.
ynumberAmount of vertical mouse wheel movement. Positive values indicate upward movement.

love.audio

love.audio.getActiveEffects

Gets a list of the names of the currently enabled effects.

love.audio.getActiveSourceCount

Gets the current number of simultaneously playing sources.

count = love.audio.getActiveSourceCount()

countnumberThe current number of simultaneously playing sources.

love.audio.getDistanceModel

Returns the distance attenuation model.

model = love.audio.getDistanceModel()

modelDistanceModelThe current distance model. The default is 'inverseclamped'.

love.audio.getDopplerScale

Gets the current global scale factor for velocity-based doppler effects.

scale = love.audio.getDopplerScale()

scalenumberThe current doppler scale factor.

love.audio.getEffect

Gets the settings associated with an effect.

settings = love.audio.getEffect( name )

settingstableThe settings associated with the effect.
namestringThe name of the effect.

love.audio.getMaxSceneEffects

Gets the maximum number of active effects supported by the system.

maximum = love.audio.getMaxSceneEffects()

maximumnumberThe maximum number of active effects.

love.audio.getMaxSourceEffects

Gets the maximum number of active Effects in a single Source object, that the system can support.

maximum = love.audio.getMaxSourceEffects()

maximumnumberThe maximum number of active Effects per Source.

love.audio.getOrientation

Returns the orientation of the listener.

fx, fy, fz, ux, uy, uz = love.audio.getOrientation()

fx, fy, fznumberForward vector of the listener orientation.
ux, uy, uznumberUp vector of the listener orientation.

love.audio.getPosition

Returns the position of the listener. Please note that positional audio only works for mono (i.e. non-stereo) sources.

x, y, z = love.audio.getPosition()

xnumberThe X position of the listener.
ynumberThe Y position of the listener.
znumberThe Z position of the listener.

love.audio.getRecordingDevices

Gets a list of RecordingDevices on the system.

The first device in the list is the user's default recording device. The list may be empty if there are no microphones connected to the system.

Audio recording is currently not supported on iOS and Android.

devices = love.audio.getRecordingDevices()

devicestableThe list of connected recording devices.

love.audio.getSourceCount

Gets the current number of simultaneously playing sources.

numSources = love.audio.getSourceCount()

numSourcesnumberThe current number of simultaneously playing sources.

love.audio.getVelocity

Returns the velocity of the listener.

x, y, z = love.audio.getVelocity()

xnumberThe X velocity of the listener.
ynumberThe Y velocity of the listener.
znumberThe Z velocity of the listener.

love.audio.getVolume

Returns the master volume.

volume = love.audio.getVolume()

volumenumberThe current master volume

love.audio.isEffectsSupported

Gets whether audio effects are supported in the system.

supported = love.audio.isEffectsSupported()

supportedbooleanTrue if effects are supported, false otherwise.

love.audio.newQueueableSource

Creates a new Source usable for real-time generated sound playback with Source:queue.

source = love.audio.newQueueableSource( samplerate, bitdepth, channels, buffercount )

sourceSourceThe new Source usable with Source:queue.
sampleratenumberNumber of samples per second when playing.
bitdepthnumberBits per sample (8 or 16).
channelsnumber1 for mono or 2 for stereo.
buffercount (0)numberThe number of buffers that can be queued up at any given time with Source:queue. Cannot be greater than 64. A sensible default (~8) is chosen if no value is specified.

love.audio.newSource

Creates a new Source from a filepath, File, Decoder or SoundData.

Sources created from SoundData are always static.

source = love.audio.newSource( filename, type )

sourceSourceA new Source that can play the specified audio.
filenamestringThe filepath to the audio file.
typeSourceTypeStreaming or static source.

source = love.audio.newSource( file, type )

sourceSourceA new Source that can play the specified audio.
fileFileA File pointing to an audio file.
typeSourceTypeStreaming or static source.

source = love.audio.newSource( decoder, type )

sourceSourceA new Source that can play the specified audio.
decoderDecoderThe Decoder to create a Source from.
typeSourceTypeStreaming or static source.

source = love.audio.newSource( data, type )

sourceSourceA new Source that can play the specified audio.
dataFileDataThe FileData to create a Source from.
typeSourceTypeStreaming or static source.

source = love.audio.newSource( data )

sourceSourceA new Source that can play the specified audio. The SourceType of the returned audio is 'static'.
dataSoundDataThe SoundData to create a Source from.

love.audio.pause

Pauses specific or all currently played Sources.

Sources = love.audio.pause()

SourcestableA table containing a list of Sources that were paused by this call.

love.audio.pause( source, ... )

sourceSourceThe first Source to pause.
...SourceAdditional Sources to pause.

love.audio.pause( sources )

sourcestableA table containing a list of Sources to pause.

love.audio.play

Plays the specified Source.

love.audio.play( source )

sourceSourceThe Source to play.

love.audio.play( sources )

sourcestableTable containing a list of Sources to play.

love.audio.play( source1, source2, ... )

source1SourceThe first Source to play.
source2SourceThe second Source to play.
...SourceAdditional Sources to play.

love.audio.setDistanceModel

Sets the distance attenuation model.

love.audio.setDistanceModel( model )

modelDistanceModelThe new distance model.

love.audio.setDopplerScale

Sets a global scale factor for velocity-based doppler effects. The default scale value is 1.

love.audio.setDopplerScale( scale )

scalenumberThe new doppler scale factor. The scale must be greater than 0.

love.audio.setEffect

Defines an effect that can be applied to a Source.

Not all system supports audio effects. Use love.audio.isEffectsSupported to check.

success = love.audio.setEffect( name, settings )

successbooleanWhether the effect was successfully created.
namestringThe name of the effect.
settingstableThe settings to use for this effect, with the following fields:
settings.typeEffectTypeThe type of effect to use.
settings.volumenumberThe volume of the effect.
settings....numberEffect-specific settings. See EffectType for available effects and their corresponding settings.

success = love.audio.setEffect( name, enabled )

successbooleanWhether the effect was successfully disabled.
namestringThe name of the effect.
enabled (true)booleanIf false and the given effect name was previously set, disables the effect.

love.audio.setMixWithSystem

Sets whether the system should mix the audio with the system's audio.

success = love.audio.setMixWithSystem( mix )

successbooleanTrue if the change succeeded, false otherwise.
mixbooleanTrue to enable mixing, false to disable it.

love.audio.setOrientation

Sets the orientation of the listener.

love.audio.setOrientation( fx, fy, fz, ux, uy, uz )

fx, fy, fznumberForward vector of the listener orientation.
ux, uy, uznumberUp vector of the listener orientation.

love.audio.setPosition

Sets the position of the listener, which determines how sounds play.

love.audio.setPosition( x, y, z )

xnumberThe x position of the listener.
ynumberThe y position of the listener.
znumberThe z position of the listener.

love.audio.setVelocity

Sets the velocity of the listener.

love.audio.setVelocity( x, y, z )

xnumberThe X velocity of the listener.
ynumberThe Y velocity of the listener.
znumberThe Z velocity of the listener.

love.audio.setVolume

Sets the master volume.

love.audio.setVolume( volume )

volumenumber1.0 is max and 0.0 is off.

love.audio.stop

Stops currently played sources.

love.audio.stop()

love.audio.stop( source )

sourceSourceThe source on which to stop the playback.

love.audio.stop( source1, source2, ... )

source1SourceThe first Source to stop.
source2SourceThe second Source to stop.
...SourceAdditional Sources to stop.

love.audio.stop( sources )

sourcestableA table containing a list of Sources to stop.

RecordingDevice:getBitDepth

Gets the number of bits per sample in the data currently being recorded.

bits = RecordingDevice:getBitDepth()

bitsnumberThe number of bits per sample in the data that's currently being recorded.

RecordingDevice:getChannelCount

Gets the number of channels currently being recorded (mono or stereo).

channels = RecordingDevice:getChannelCount()

channelsnumberThe number of channels being recorded (1 for mono, 2 for stereo).

RecordingDevice:getData

Gets all recorded audio SoundData stored in the device's internal ring buffer.

The internal ring buffer is cleared when this function is called, so calling it again will only get audio recorded after the previous call. If the device's internal ring buffer completely fills up before getData is called, the oldest data that doesn't fit into the buffer will be lost.

data = RecordingDevice:getData()

dataSoundDataThe recorded audio data, or nil if the device isn't recording.

RecordingDevice:getName

Gets the name of the recording device.

name = RecordingDevice:getName()

namestringThe name of the device.

RecordingDevice:getSampleCount

Gets the number of currently recorded samples.

samples = RecordingDevice:getSampleCount()

samplesnumberThe number of samples that have been recorded so far.

RecordingDevice:getSampleRate

Gets the number of samples per second currently being recorded.

rate = RecordingDevice:getSampleRate()

ratenumberThe number of samples being recorded per second (sample rate).

RecordingDevice:isRecording

Gets whether the device is currently recording.

recording = RecordingDevice:isRecording()

recordingbooleanTrue if the recording, false otherwise.

RecordingDevice:start

Begins recording audio using this device.

success = RecordingDevice:start( samplecount, samplerate, bitdepth, channels )

successbooleanTrue if the device successfully began recording using the specified parameters, false if not.
samplecountnumberThe maximum number of samples to store in an internal ring buffer when recording. RecordingDevice:getData clears the internal buffer when called.
samplerate (8000)numberThe number of samples per second to store when recording.
bitdepth (16)numberThe number of bits per sample.
channels (1)numberWhether to record in mono or stereo. Most microphones don't support more than 1 channel.

RecordingDevice:stop

Stops recording audio from this device. Any sound data currently in the device's buffer will be returned.

data = RecordingDevice:stop()

dataSoundDataThe sound data currently in the device's buffer, or nil if the device wasn't recording.

Source:clone

Creates an identical copy of the Source in the stopped state.

Static Sources will use significantly less memory and take much less time to be created if Source:clone is used to create them instead of love.audio.newSource, so this method should be preferred when making multiple Sources which play the same sound.

source = Source:clone()

sourceSourceThe new identical copy of this Source.

Source:getActiveEffects

Gets a list of the Source's active effect names.

effects = Source:getActiveEffects()

effectstableA list of the source's active effect names.

Source:getAirAbsorption

Gets the amount of air absorption applied to the Source.

By default the value is set to 0 which means that air absorption effects are disabled. A value of 1 will apply high frequency attenuation to the Source at a rate of 0.05 dB per meter.

amount = Source:getAirAbsorption()

amountnumberThe amount of air absorption applied to the Source.

Source:getAttenuationDistances

Gets the reference and maximum attenuation distances of the Source. The values, combined with the current DistanceModel, affect how the Source's volume attenuates based on distance from the listener.

ref, max = Source:getAttenuationDistances()

refnumberThe current reference attenuation distance. If the current DistanceModel is clamped, this is the minimum distance before the Source is no longer attenuated.
maxnumberThe current maximum attenuation distance.

Source:getChannelCount

Gets the number of channels in the Source. Only 1-channel (mono) Sources can use directional and positional effects.

channels = Source:getChannelCount()

channelsnumber1 for mono, 2 for stereo.

Source:getCone

Gets the Source's directional volume cones. Together with Source:setDirection, the cone angles allow for the Source's volume to vary depending on its direction.

innerAngle, outerAngle, outerVolume = Source:getCone()

innerAnglenumberThe inner angle from the Source's direction, in radians. The Source will play at normal volume if the listener is inside the cone defined by this angle.
outerAnglenumberThe outer angle from the Source's direction, in radians. The Source will play at a volume between the normal and outer volumes, if the listener is in between the cones defined by the inner and outer angles.
outerVolumenumberThe Source's volume when the listener is outside both the inner and outer cone angles.

Source:getDirection

Gets the direction of the Source.

x, y, z = Source:getDirection()

xnumberThe X part of the direction vector.
ynumberThe Y part of the direction vector.
znumberThe Z part of the direction vector.

Source:getDuration

Gets the duration of the Source. For streaming Sources it may not always be sample-accurate, and may return -1 if the duration cannot be determined at all.

duration = Source:getDuration( unit )

durationnumberThe duration of the Source, or -1 if it cannot be determined.
unit ('seconds')TimeUnitThe time unit for the return value.

Source:getEffect

Gets the filter settings associated to a specific effect.

This function returns nil if the effect was applied with no filter settings associated to it.

filtersettings = Source:getEffect( name, filtersettings )

filtersettingstableThe settings for the filter associated to this effect, or nil if the effect is not present in this Source or has no filter associated. The table has the following fields:
filtersettings.volumenumberThe overall volume of the audio.
filtersettings.highgainnumberVolume of high-frequency audio. Only applies to low-pass and band-pass filters.
filtersettings.lowgainnumberVolume of low-frequency audio. Only applies to high-pass and band-pass filters.
namestringThe name of the effect.
filtersettings ({})tableAn optional empty table that will be filled with the filter settings.

Source:getFilter

Gets the filter settings currently applied to the Source.

settings = Source:getFilter()

settingstableThe filter settings to use for this Source, or nil if the Source has no active filter. The table has the following fields:
settings.typeFilterTypeThe type of filter to use.
settings.volumenumberThe overall volume of the audio.
settings.highgainnumberVolume of high-frequency audio. Only applies to low-pass and band-pass filters.
settings.lowgainnumberVolume of low-frequency audio. Only applies to high-pass and band-pass filters.

Source:getFreeBufferCount

Gets the number of free buffer slots in a queueable Source. If the queueable Source is playing, this value will increase up to the amount the Source was created with. If the queueable Source is stopped, it will process all of its internal buffers first, in which case this function will always return the amount it was created with.

buffers = Source:getFreeBufferCount()

buffersnumberHow many more SoundData objects can be queued up.

Source:getPitch

Gets the current pitch of the Source.

pitch = Source:getPitch()

pitchnumberThe pitch, where 1.0 is normal.

Source:getPosition

Gets the position of the Source.

x, y, z = Source:getPosition()

xnumberThe X position of the Source.
ynumberThe Y position of the Source.
znumberThe Z position of the Source.

Source:getRolloff

Returns the rolloff factor of the source.

rolloff = Source:getRolloff()

rolloffnumberThe rolloff factor.

Source:getType

Gets the type of the Source.

sourcetype = Source:getType()

sourcetypeSourceTypeThe type of the source.

Source:getVelocity

Gets the velocity of the Source.

x, y, z = Source:getVelocity()

xnumberThe X part of the velocity vector.
ynumberThe Y part of the velocity vector.
znumberThe Z part of the velocity vector.

Source:getVolume

Gets the current volume of the Source.

volume = Source:getVolume()

volumenumberThe volume of the Source, where 1.0 is normal volume.

Source:getVolumeLimits

Returns the volume limits of the source.

min, max = Source:getVolumeLimits()

minnumberThe minimum volume.
maxnumberThe maximum volume.

Source:isLooping

Returns whether the Source will loop.

loop = Source:isLooping()

loopbooleanTrue if the Source will loop, false otherwise.

Source:isPlaying

Returns whether the Source is playing.

playing = Source:isPlaying()

playingbooleanTrue if the Source is playing, false otherwise.

Source:isRelative

Gets whether the Source's position, velocity, direction, and cone angles are relative to the listener.

relative = Source:isRelative()

relativebooleanTrue if the position, velocity, direction and cone angles are relative to the listener, false if they're absolute.

Source:pause

Pauses the Source.

Source:pause()

Source:play

Starts playing the Source.

success = Source:play()

successbooleanWhether the Source was able to successfully start playing.

Source:queue

Queues SoundData for playback in a queueable Source.

This method requires the Source to be created via love.audio.newQueueableSource.

success = Source:queue( sounddata )

successbooleanTrue if the data was successfully queued for playback, false if there were no available buffers to use for queueing.
sounddataSoundDataThe data to queue. The SoundData's sample rate, bit depth, and channel count must match the Source's.

Source:seek

Sets the currently playing position of the Source.

Source:seek( offset, unit )

offsetnumberThe position to seek to.
unit ('seconds')TimeUnitThe unit of the position value.

Source:setAirAbsorption

Sets the amount of air absorption applied to the Source.

By default the value is set to 0 which means that air absorption effects are disabled. A value of 1 will apply high frequency attenuation to the Source at a rate of 0.05 dB per meter.

Air absorption can simulate sound transmission through foggy air, dry air, smoky atmosphere, etc. It can be used to simulate different atmospheric conditions within different locations in an area.

Source:setAirAbsorption( amount )

amountnumberThe amount of air absorption applied to the Source. Must be between 0 and 10.

Source:setAttenuationDistances

Sets the reference and maximum attenuation distances of the Source. The parameters, combined with the current DistanceModel, affect how the Source's volume attenuates based on distance.

Distance attenuation is only applicable to Sources based on mono (rather than stereo) audio.

Source:setAttenuationDistances( ref, max )

refnumberThe new reference attenuation distance. If the current DistanceModel is clamped, this is the minimum attenuation distance.
maxnumberThe new maximum attenuation distance.

Source:setCone

Sets the Source's directional volume cones. Together with Source:setDirection, the cone angles allow for the Source's volume to vary depending on its direction.

Source:setCone( innerAngle, outerAngle, outerVolume )

innerAnglenumberThe inner angle from the Source's direction, in radians. The Source will play at normal volume if the listener is inside the cone defined by this angle.
outerAnglenumberThe outer angle from the Source's direction, in radians. The Source will play at a volume between the normal and outer volumes, if the listener is in between the cones defined by the inner and outer angles.
outerVolume (0)numberThe Source's volume when the listener is outside both the inner and outer cone angles.

Source:setDirection

Sets the direction vector of the Source. A zero vector makes the source non-directional.

Source:setDirection( x, y, z )

xnumberThe X part of the direction vector.
ynumberThe Y part of the direction vector.
znumberThe Z part of the direction vector.

Source:setEffect

Applies an audio effect to the Source.

The effect must have been previously defined using love.audio.setEffect.

success = Source:setEffect( name, enable )

successbooleanWhether the effect was successfully applied to this Source.
namestringThe name of the effect previously set up with love.audio.setEffect.
enable (true)booleanIf false and the given effect name was previously enabled on this Source, disables the effect.

success = Source:setEffect( name, filtersettings )

successbooleanWhether the effect and filter were successfully applied to this Source.
namestringThe name of the effect previously set up with love.audio.setEffect.
filtersettingstableThe filter settings to apply prior to the effect, with the following fields:
filtersettings.typeFilterTypeThe type of filter to use.
filtersettings.volumenumberThe overall volume of the audio. Must be between 0 and 1.
filtersettings.highgainnumberVolume of high-frequency audio. Only applies to low-pass and band-pass filters. Must be between 0 and 1.
filtersettings.lowgainnumberVolume of low-frequency audio. Only applies to high-pass and band-pass filters. Must be between 0 and 1.

Source:setFilter

Sets a low-pass, high-pass, or band-pass filter to apply when playing the Source.

success = Source:setFilter( settings )

successbooleanWhether the filter was successfully applied to the Source.
settingstableThe filter settings to use for this Source, with the following fields:
settings.typeFilterTypeThe type of filter to use.
settings.volumenumberThe overall volume of the audio. Must be between 0 and 1.
settings.highgainnumberVolume of high-frequency audio. Only applies to low-pass and band-pass filters. Must be between 0 and 1.
settings.lowgainnumberVolume of low-frequency audio. Only applies to high-pass and band-pass filters. Must be between 0 and 1.

Source:setFilter()

Source:setLooping

Sets whether the Source should loop.

Source:setLooping( loop )

loopbooleanTrue if the source should loop, false otherwise.

Source:setPitch

Sets the pitch of the Source.

Source:setPitch( pitch )

pitchnumberCalculated with regard to 1 being the base pitch. Each reduction by 50 percent equals a pitch shift of -12 semitones (one octave reduction). Each doubling equals a pitch shift of 12 semitones (one octave increase). Zero is not a legal value.

Source:setPosition

Sets the position of the Source. Please note that this only works for mono (i.e. non-stereo) sound files!

Source:setPosition( x, y, z )

xnumberThe X position of the Source.
ynumberThe Y position of the Source.
znumberThe Z position of the Source.

Source:setRelative

Sets whether the parent::Source's position, velocity, direction, and cone angles are relative to the listener, or absolute.

By default, all sources are absolute and therefore relative to the origin of love's coordinate system 0, 0. Only absolute sources are affected by the position of the listener. Please note that positional audio only works for mono (i.e. non-stereo) sources.

Source:setRelative( enable )

enable ('false')booleanTrue to make the position, velocity, direction and cone angles relative to the listener, false to make them absolute.

Source:setRolloff

Sets the rolloff factor which affects the strength of the used distance attenuation.

Extended information and detailed formulas can be found in the chapter '3.4. Attenuation By Distance' of OpenAL 1.1 specification.

Source:setRolloff( rolloff )

rolloffnumberThe new rolloff factor.

Source:setVelocity

Sets the velocity of the Source.

This does '''not''' change the position of the Source, but lets the application know how it has to calculate the doppler effect.

Source:setVelocity( x, y, z )

xnumberThe X part of the velocity vector.
ynumberThe Y part of the velocity vector.
znumberThe Z part of the velocity vector.

Source:setVolume

Sets the current volume of the Source.

Source:setVolume( volume )

volumenumberThe volume for a Source, where 1.0 is normal volume. Volume cannot be raised above 1.0.

Source:setVolumeLimits

Sets the volume limits of the source. The limits have to be numbers from 0 to 1.

Source:setVolumeLimits( min, max )

minnumberThe minimum volume.
maxnumberThe maximum volume.

Source:stop

Stops a Source.

Source:stop()

Source:tell

Gets the currently playing position of the Source.

position = Source:tell( unit )

positionnumberThe currently playing position of the Source.
unit ('seconds')TimeUnitThe type of unit for the return value.

DistanceModel

none

Sources do not get attenuated.

inverse

Inverse distance attenuation.

inverseclamped

Inverse distance attenuation. Gain is clamped. In version 0.9.2 and older this is named '''inverse clamped'''.

linear

Linear attenuation.

linearclamped

Linear attenuation. Gain is clamped. In version 0.9.2 and older this is named '''linear clamped'''.

exponent

Exponential attenuation.

exponentclamped

Exponential attenuation. Gain is clamped. In version 0.9.2 and older this is named '''exponent clamped'''.

EffectType

chorus

Plays multiple copies of the sound with slight pitch and time variation. Used to make sounds sound "fuller" or "thicker".

compressor

Decreases the dynamic range of the sound, making the loud and quiet parts closer in volume, producing a more uniform amplitude throughout time.

distortion

Alters the sound by amplifying it until it clips, shearing off parts of the signal, leading to a compressed and distorted sound.

echo

Decaying feedback based effect, on the order of seconds. Also known as delay; causes the sound to repeat at regular intervals at a decreasing volume.

equalizer

Adjust the frequency components of the sound using a 4-band (low-shelf, two band-pass and a high-shelf) equalizer.

flanger

Plays two copies of the sound; while varying the phase, or equivalently delaying one of them, by amounts on the order of milliseconds, resulting in phasing sounds.

reverb

Decaying feedback based effect, on the order of milliseconds. Used to simulate the reflection off of the surroundings.

ringmodulator

An implementation of amplitude modulation; multiplies the source signal with a simple waveform, to produce either volume changes, or inharmonic overtones.

EffectWaveform

sawtooth

A sawtooth wave, also known as a ramp wave. Named for its linear rise, and (near-)instantaneous fall along time.

sine

A sine wave. Follows a trigonometric sine function.

square

A square wave. Switches between high and low states (near-)instantaneously.

triangle

A triangle wave. Follows a linear rise and fall that repeats periodically.

FilterType

lowpass

Low-pass filter. High frequency sounds are attenuated.

highpass

High-pass filter. Low frequency sounds are attenuated.

bandpass

Band-pass filter. Both high and low frequency sounds are attenuated based on the given parameters.

SourceType

static

The whole audio is decoded.

stream

The audio is decoded in chunks when needed.

queue

The audio must be manually queued by the user.

TimeUnit

seconds

Regular seconds.

samples

Audio samples.

love.data

love.data.compress

Compresses a string or data using a specific compression algorithm.

compressedData = love.data.compress( container, format, rawstring, level )

compressedDatavalueCompressedData/string which contains the compressed version of rawstring.
containerContainerTypeWhat type to return the compressed data as.
formatCompressedDataFormatThe format to use when compressing the string.
rawstringstringThe raw (un-compressed) string to compress.
level (-1)numberThe 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.

compressedData = love.data.compress( container, format, data, level )

compressedDatavalueCompressedData/string which contains the compressed version of data.
containerContainerTypeWhat type to return the compressed data as.
formatCompressedDataFormatThe format to use when compressing the data.
dataDataA Data object containing the raw (un-compressed) data to compress.
level (-1)numberThe 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.

love.data.decode

Decode Data or a string from any of the EncodeFormats to Data or string.

decoded = love.data.decode( container, format, sourceString )

decodedvalueByteData/string which contains the decoded version of source.
containerContainerTypeWhat type to return the decoded data as.
formatEncodeFormatThe format of the input data.
sourceStringstringThe raw (encoded) data to decode.

decoded = love.data.decode( container, format, sourceData )

decodedvalueByteData/string which contains the decoded version of source.
containerContainerTypeWhat type to return the decoded data as.
formatEncodeFormatThe format of the input data.
sourceDataDataThe raw (encoded) data to decode.

love.data.decompress

Decompresses a CompressedData or previously compressed string or Data object.

decompressedData = love.data.decompress( container, compressedData )

decompressedDatavalueData/string containing the raw decompressed data.
containerContainerTypeWhat type to return the decompressed data as.
compressedDataCompressedDataThe compressed data to decompress.

decompressedData = love.data.decompress( container, format, compressedString )

decompressedDatavalueData/string containing the raw decompressed data.
containerContainerTypeWhat type to return the decompressed data as.
formatCompressedDataFormatThe format that was used to compress the given string.
compressedStringstringA string containing data previously compressed with love.data.compress.

decompressedData = love.data.decompress( container, format, data )

decompressedDatavalueData/string containing the raw decompressed data.
containerContainerTypeWhat type to return the decompressed data as.
formatCompressedDataFormatThe format that was used to compress the given data.
dataDataA Data object containing data previously compressed with love.data.compress.

love.data.encode

Encode Data or a string to a Data or string in one of the EncodeFormats.

encoded = love.data.encode( container, format, sourceString, linelength )

encodedvalueByteData/string which contains the encoded version of source.
containerContainerTypeWhat type to return the encoded data as.
formatEncodeFormatThe format of the output data.
sourceStringstringThe raw data to encode.
linelength (0)numberThe maximum line length of the output. Only supported for base64, ignored if 0.

encoded = love.data.encode( container, format, sourceData, linelength )

encodedvalueByteData/string which contains the encoded version of source.
containerContainerTypeWhat type to return the encoded data as.
formatEncodeFormatThe format of the output data.
sourceDataDataThe raw data to encode.
linelength (0)numberThe maximum line length of the output. Only supported for base64, ignored if 0.

love.data.getPackedSize

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.

size = love.data.getPackedSize( format )

sizenumberThe size in bytes that the packed data will use.
formatstringA string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.

love.data.hash

Compute the message digest of a string using a specified hash algorithm.

rawdigest = love.data.hash( hashFunction, string )

rawdigeststringRaw message digest string.
hashFunctionHashFunctionHash algorithm to use.
stringstringString to hash.

rawdigest = love.data.hash( hashFunction, data )

rawdigeststringRaw message digest string.
hashFunctionHashFunctionHash algorithm to use.
dataDataData to hash.

love.data.newByteData

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.

bytedata = love.data.newByteData( datastring )

bytedataByteDataThe new Data object.
datastringstringThe byte string to copy.

bytedata = love.data.newByteData( Data, offset, size )

bytedataByteDataThe new Data object.
DataDataThe existing Data object to copy.
offset (0)numberThe offset of the subsection to copy, in bytes.
size (data:getSize())numberThe size in bytes of the new Data object.

bytedata = love.data.newByteData( size )

bytedataByteDataThe new Data object.
sizenumberThe size in bytes of the new Data object.

love.data.newDataView

Creates a new Data referencing a subsection of an existing Data object.

view = love.data.newDataView( data, offset, size )

viewDataThe new Data view.
dataDataThe Data object to reference.
offsetnumberThe offset of the subsection to reference, in bytes.
sizenumberThe size in bytes of the subsection to reference.

love.data.pack

Packs (serializes) simple Lua values.

This function behaves the same as Lua 5.3's string.pack.

data = love.data.pack( container, format, v1, ... )

datavalueData/string which contains the serialized data.
containerContainerTypeWhat type to return the encoded data as.
formatstringA string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.
v1valueThe first value (number, boolean, or string) to serialize.
...valueAdditional values to serialize.

love.data.unpack

Unpacks (deserializes) a byte-string or Data into simple Lua values.

This function behaves the same as Lua 5.3's string.unpack.

v1, ..., index = love.data.unpack( format, datastring, pos )

v1valueThe first value (number, boolean, or string) that was unpacked.
...valueAdditional unpacked values.
indexnumberThe index of the first unread byte in the data string.
formatstringA string determining how the values were packed. Follows the rules of Lua 5.3's string.pack format strings.
datastringstringA string containing the packed (serialized) data.
pos (1)numberWhere to start reading in the string. Negative values can be used to read relative from the end of the string.

v1, ..., index = love.data.unpack( format, data, pos )

v1valueThe first value (number, boolean, or string) that was unpacked.
...valueAdditional unpacked values.
indexnumberThe 1-based index of the first unread byte in the Data.
formatstringA string determining how the values were packed. Follows the rules of Lua 5.3's string.pack format strings.
dataDataA Data object containing the packed (serialized) data.
pos (1)number1-based index indicating where to start reading in the Data. Negative values can be used to read relative from the end of the Data object.

ContainerType

data

Return type is ByteData.

string

Return type is string.

EncodeFormat

base64

Encode/decode data as base64 binary-to-text encoding.

hex

Encode/decode data as hexadecimal string.

HashFunction

md5

MD5 hash algorithm (16 bytes).

sha1

SHA1 hash algorithm (20 bytes).

sha224

SHA2 hash algorithm with message digest size of 224 bits (28 bytes).

sha256

SHA2 hash algorithm with message digest size of 256 bits (32 bytes).

sha384

SHA2 hash algorithm with message digest size of 384 bits (48 bytes).

sha512

SHA2 hash algorithm with message digest size of 512 bits (64 bytes).

love.event

love.event.clear

Clears the event queue.

love.event.clear()

love.event.poll

Returns an iterator for messages in the event queue.

i = love.event.poll()

ifunctionIterator function usable in a for loop.

love.event.pump

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).

love.event.pump()

love.event.push

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.

love.event.push( n, a, b, c, d, e, f, ... )

nEventThe name of the event.
a (nil)VariantFirst event argument.
b (nil)VariantSecond event argument.
c (nil)VariantThird event argument.
d (nil)VariantFourth event argument.
e (nil)VariantFifth event argument.
f (nil)VariantSixth event argument.
... (nil)VariantFurther event arguments may follow.

love.event.quit

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.

love.event.quit( exitstatus )

exitstatus (0)numberThe program exit status to use when closing the application.

love.event.quit( 'restart' )

'restart'stringTells the default love.run to exit and restart the game without relaunching the executable.

love.event.wait

Like love.event.poll(), but blocks until there is an event in the queue.

n, a, b, c, d, e, f, ... = love.event.wait()

nEventThe name of event.
aVariantFirst event argument.
bVariantSecond event argument.
cVariantThird event argument.
dVariantFourth event argument.
eVariantFifth event argument.
fVariantSixth event argument.
...VariantFurther event arguments may follow.

Event

focus

Window focus gained or lost

joystickpressed

Joystick pressed

joystickreleased

Joystick released

keypressed

Key pressed

keyreleased

Key released

mousepressed

Mouse pressed

mousereleased

Mouse released

quit

Quit

resize

Window size changed by the user

visible

Window is minimized or un-minimized by the user

mousefocus

Window mouse focus gained or lost

threaderror

A Lua error has occurred in a thread

joystickadded

Joystick connected

joystickremoved

Joystick disconnected

joystickaxis

Joystick axis motion

joystickhat

Joystick hat pressed

gamepadpressed

Joystick's virtual gamepad button pressed

gamepadreleased

Joystick's virtual gamepad button released

gamepadaxis

Joystick's virtual gamepad axis moved

textinput

User entered text

mousemoved

Mouse position changed

lowmemory

Running out of memory on mobile devices system

textedited

Candidate text for an IME changed

wheelmoved

Mouse wheel moved

touchpressed

Touch screen touched

touchreleased

Touch screen stop touching

touchmoved

Touch press moved inside touch screen

directorydropped

Directory is dragged and dropped onto the window

filedropped

File is dragged and dropped onto the window.

jp

Joystick pressed

jr

Joystick released

kp

Key pressed

kr

Key released

mp

Mouse pressed

mr

Mouse released

q

Quit

f

Window focus gained or lost

love.filesystem

love.filesystem.append

Append data to an existing file.

success, errormsg = love.filesystem.append( name, data, size )

successbooleanTrue if the operation was successful, or nil if there was an error.
errormsgstringThe error message on failure.
namestringThe name (and path) of the file.
datastringThe string data to append to the file.
size (all)numberHow many bytes to write.

success, errormsg = love.filesystem.append( name, data, size )

successbooleanTrue if the operation was successful, or nil if there was an error.
errormsgstringThe error message on failure.
namestringThe name (and path) of the file.
dataDataThe Data object to append to the file.
size (all)numberHow many bytes to write.

love.filesystem.areSymlinksEnabled

Gets whether love.filesystem follows symbolic links.

enable = love.filesystem.areSymlinksEnabled()

enablebooleanWhether love.filesystem follows symbolic links.

love.filesystem.createDirectory

Recursively creates a directory.

When called with 'a/b' it creates both 'a' and 'a/b', if they don't exist already.

success = love.filesystem.createDirectory( name )

successbooleanTrue if the directory was created, false if not.
namestringThe directory to create.

love.filesystem.getAppdataDirectory

Returns the application data directory (could be the same as getUserDirectory)

path = love.filesystem.getAppdataDirectory()

pathstringThe path of the application data directory

love.filesystem.getCRequirePath

Gets the filesystem paths that will be searched for c libraries when require is called.

The paths string returned by this function is a sequence of path templates separated by semicolons. The argument passed to ''require'' will be inserted in place of any question mark ('?') character in each template (after the dot characters in the argument passed to ''require'' are replaced by directory separators.) Additionally, any occurrence of a double question mark ('??') will be replaced by the name passed to require and the default library extension for the platform.

The paths are relative to the game's source and save directories, as well as any paths mounted with love.filesystem.mount.

paths = love.filesystem.getCRequirePath()

pathsstringThe paths that the ''require'' function will check for c libraries in love's filesystem.

love.filesystem.getDirectoryItems

Returns a table with the names of files and subdirectories in the specified path. The table is not sorted in any way; the order is undefined.

If the path passed to the function exists in the game and the save directory, it will list the files and directories from both places.

files = love.filesystem.getDirectoryItems( dir )

filestableA sequence with the names of all files and subdirectories as strings.
dirstringThe directory.

files = love.filesystem.getDirectoryItems( dir, callback )

filestableA sequence with the names of all files and subdirectories as strings.
dirstringThe directory.
callbackfunctionA function which is called for each file and folder in the directory. The filename is passed to the function as an argument.

love.filesystem.getIdentity

Gets the write directory name for your game.

Note that this only returns the name of the folder to store your files in, not the full path.

name = love.filesystem.getIdentity()

namestringThe identity that is used as write directory.

love.filesystem.getInfo

Gets information about the specified file or directory.

info = love.filesystem.getInfo( path, filtertype )

infotableA table containing information about the specified path, or nil if nothing exists at the path. The table contains the following fields:
info.typeFileTypeThe type of the object at the path (file, directory, symlink, etc.)
info.sizenumberThe size in bytes of the file, or nil if it can't be determined.
info.modtimenumberThe file's last modification time in seconds since the unix epoch, or nil if it can't be determined.
pathstringThe file or directory path to check.
filtertype (nil)FileTypeIf supplied, this parameter causes getInfo to only return the info table if the item at the given path matches the specified file type.

info = love.filesystem.getInfo( path, info )

infotableThe table given as an argument, or nil if nothing exists at the path. The table will be filled in with the following fields:
info.typeFileTypeThe type of the object at the path (file, directory, symlink, etc.)
info.sizenumberThe size in bytes of the file, or nil if it can't be determined.
info.modtimenumberThe file's last modification time in seconds since the unix epoch, or nil if it can't be determined.
pathstringThe file or directory path to check.
infotableA table which will be filled in with info about the specified path.

info = love.filesystem.getInfo( path, filtertype, info )

infotableThe table given as an argument, or nil if nothing exists at the path. The table will be filled in with the following fields:
info.typeFileTypeThe type of the object at the path (file, directory, symlink, etc.)
info.sizenumberThe size in bytes of the file, or nil if it can't be determined.
info.modtimenumberThe file's last modification time in seconds since the unix epoch, or nil if it can't be determined.
pathstringThe file or directory path to check.
filtertypeFileTypeCauses getInfo to only return the info table if the item at the given path matches the specified file type.
infotableA table which will be filled in with info about the specified path.

love.filesystem.getRealDirectory

Gets the platform-specific absolute path of the directory containing a filepath.

This can be used to determine whether a file is inside the save directory or the game's source .love.

realdir = love.filesystem.getRealDirectory( filepath )

realdirstringThe platform-specific full path of the directory containing the filepath.
filepathstringThe filepath to get the directory of.

love.filesystem.getRequirePath

Gets the filesystem paths that will be searched when require is called.

The paths string returned by this function is a sequence of path templates separated by semicolons. The argument passed to ''require'' will be inserted in place of any question mark ('?') character in each template (after the dot characters in the argument passed to ''require'' are replaced by directory separators.)

The paths are relative to the game's source and save directories, as well as any paths mounted with love.filesystem.mount.

paths = love.filesystem.getRequirePath()

pathsstringThe paths that the ''require'' function will check in love's filesystem.

love.filesystem.getSaveDirectory

Gets the full path to the designated save directory.

This can be useful if you want to use the standard io library (or something else) to

read or write in the save directory.

dir = love.filesystem.getSaveDirectory()

dirstringThe absolute path to the save directory.

love.filesystem.getSource

Returns the full path to the the .love file or directory. If the game is fused to the LÖVE executable, then the executable is returned.

path = love.filesystem.getSource()

pathstringThe full platform-dependent path of the .love file or directory.

love.filesystem.getSourceBaseDirectory

Returns the full path to the directory containing the .love file. If the game is fused to the LÖVE executable, then the directory containing the executable is returned.

If love.filesystem.isFused is true, the path returned by this function can be passed to love.filesystem.mount, which will make the directory containing the main game (e.g. C:\Program Files\coolgame\) readable by love.filesystem.

path = love.filesystem.getSourceBaseDirectory()

pathstringThe full platform-dependent path of the directory containing the .love file.

love.filesystem.getUserDirectory

Returns the path of the user's directory

path = love.filesystem.getUserDirectory()

pathstringThe path of the user's directory

love.filesystem.getWorkingDirectory

Gets the current working directory.

cwd = love.filesystem.getWorkingDirectory()

cwdstringThe current working directory.

love.filesystem.isFused

Gets whether the game is in fused mode or not.

If a game is in fused mode, its save directory will be directly in the Appdata directory instead of Appdata/LOVE/. The game will also be able to load C Lua dynamic libraries which are located in the save directory.

A game is in fused mode if the source .love has been fused to the executable (see Game Distribution), or if '--fused' has been given as a command-line argument when starting the game.

fused = love.filesystem.isFused()

fusedbooleanTrue if the game is in fused mode, false otherwise.

love.filesystem.lines

Iterate over the lines in a file.

iterator = love.filesystem.lines( name )

iteratorfunctionA function that iterates over all the lines in the file
namestringThe name (and path) of the file

love.filesystem.load

Loads a Lua file (but does not run it).

chunk, errormsg = love.filesystem.load( name )

chunkfunctionThe loaded chunk.
errormsgstringThe error message if file could not be opened.
namestringThe name (and path) of the file.

love.filesystem.mount

Mounts a zip file or folder in the game's save directory for reading.

It is also possible to mount love.filesystem.getSourceBaseDirectory if the game is in fused mode.

success = love.filesystem.mount( archive, mountpoint, appendToPath )

successbooleanTrue if the archive was successfully mounted, false otherwise.
archivestringThe folder or zip file in the game's save directory to mount.
mountpointstringThe new path the archive will be mounted to.
appendToPath (false)booleanWhether the archive will be searched when reading a filepath before or after already-mounted archives. This includes the game's source and save directories.

success = love.filesystem.mount( filedata, mountpoint, appendToPath )

successbooleanTrue if the archive was successfully mounted, false otherwise.
filedataFileDataThe FileData object in memory to mount.
mountpointstringThe new path the archive will be mounted to.
appendToPath (false)booleanWhether the archive will be searched when reading a filepath before or after already-mounted archives. This includes the game's source and save directories.

success = love.filesystem.mount( data, archivename, mountpoint, appendToPath )

successbooleanTrue if the archive was successfully mounted, false otherwise.
dataDataThe Data object in memory to mount.
archivenamestringThe name to associate the mounted data with, for use with love.filesystem.unmount. Must be unique compared to other mounted data.
mountpointstringThe new path the archive will be mounted to.
appendToPath (false)booleanWhether the archive will be searched when reading a filepath before or after already-mounted archives. This includes the game's source and save directories.

love.filesystem.newFile

Creates a new File object.

It needs to be opened before it can be accessed.

file = love.filesystem.newFile( filename )

fileFileThe new File object.
filenamestringThe filename of the file.

file, errorstr = love.filesystem.newFile( filename, mode )

fileFileThe new File object, or nil if an error occurred.
errorstrstringThe error string if an error occurred.
filenamestringThe filename of the file.
modeFileModeThe mode to open the file in.

love.filesystem.newFileData

Creates a new FileData object.

data = love.filesystem.newFileData( contents, name )

dataFileDataYour new FileData.
contentsstringThe contents of the file.
namestringThe name of the file.

data, err = love.filesystem.newFileData( filepath )

dataFileDataThe new FileData, or nil if an error occurred.
errstringThe error string, if an error occurred.
filepathstringPath to the file.

love.filesystem.read

Read the contents of a file.

contents, size, contents, error = love.filesystem.read( name, size )

contentsstringThe file contents.
sizenumberHow many bytes have been read.
contentsnilreturns nil as content.
errorstringreturns an error message.
namestringThe name (and path) of the file.
size (all)numberHow many bytes to read.

contents, size, contents, error = love.filesystem.read( container, name, size )

contentsvalueFileData or string containing the file contents.
sizenumberHow many bytes have been read.
contentsnilreturns nil as content.
errorstringreturns an error message.
containerContainerTypeWhat type to return the file's contents as.
namestringThe name (and path) of the file
size (all)numberHow many bytes to read

love.filesystem.remove

Removes a file or empty directory.

success = love.filesystem.remove( name )

successbooleanTrue if the file/directory was removed, false otherwise.
namestringThe file or directory to remove.

love.filesystem.setCRequirePath

Sets the filesystem paths that will be searched for c libraries when require is called.

The paths string returned by this function is a sequence of path templates separated by semicolons. The argument passed to ''require'' will be inserted in place of any question mark ('?') character in each template (after the dot characters in the argument passed to ''require'' are replaced by directory separators.) Additionally, any occurrence of a double question mark ('??') will be replaced by the name passed to require and the default library extension for the platform.

The paths are relative to the game's source and save directories, as well as any paths mounted with love.filesystem.mount.

love.filesystem.setCRequirePath( paths )

pathsstringThe paths that the ''require'' function will check in love's filesystem.

love.filesystem.setIdentity

Sets the write directory for your game.

Note that you can only set the name of the folder to store your files in, not the location.

love.filesystem.setIdentity( name )

namestringThe new identity that will be used as write directory.

love.filesystem.setIdentity( name )

namestringThe new identity that will be used as write directory.

love.filesystem.setRequirePath

Sets the filesystem paths that will be searched when require is called.

The paths string given to this function is a sequence of path templates separated by semicolons. The argument passed to ''require'' will be inserted in place of any question mark ('?') character in each template (after the dot characters in the argument passed to ''require'' are replaced by directory separators.)

The paths are relative to the game's source and save directories, as well as any paths mounted with love.filesystem.mount.

love.filesystem.setRequirePath( paths )

pathsstringThe paths that the ''require'' function will check in love's filesystem.

love.filesystem.setSymlinksEnabled

Sets whether love.filesystem follows symbolic links. It is enabled by default in version 0.10.0 and newer, and disabled by default in 0.9.2.

love.filesystem.setSymlinksEnabled( enable )

enablebooleanWhether love.filesystem should follow symbolic links.

love.filesystem.unmount

Unmounts a zip file or folder previously mounted for reading with love.filesystem.mount.

success = love.filesystem.unmount( archive )

successbooleanTrue if the archive was successfully unmounted, false otherwise.
archivestringThe folder or zip file in the game's save directory which is currently mounted.

love.filesystem.write

Write data to a file in the save directory. If the file existed already, it will be completely replaced by the new contents.

success, message = love.filesystem.write( name, data, size )

successbooleanIf the operation was successful.
messagestringError message if operation was unsuccessful.
namestringThe name (and path) of the file.
datastringThe string data to write to the file.
size (all)numberHow many bytes to write.

success, message = love.filesystem.write( name, data, size )

successbooleanIf the operation was successful.
messagestringError message if operation was unsuccessful.
namestringThe name (and path) of the file.
dataDataThe Data object to write to the file.
size (all)numberHow many bytes to write.

File:close

Closes a File.

success = File:close()

successbooleanWhether closing was successful.

File:flush

Flushes any buffered written data in the file to the disk.

success, err = File:flush()

successbooleanWhether the file successfully flushed any buffered data to the disk.
errstringThe error string, if an error occurred and the file could not be flushed.

File:getBuffer

Gets the buffer mode of a file.

mode, size = File:getBuffer()

modeBufferModeThe current buffer mode of the file.
sizenumberThe maximum size in bytes of the file's buffer.

File:getFilename

Gets the filename that the File object was created with. If the file object originated from the love.filedropped callback, the filename will be the full platform-dependent file path.

filename = File:getFilename()

filenamestringThe filename of the File.

File:getMode

Gets the FileMode the file has been opened with.

mode = File:getMode()

modeFileModeThe mode this file has been opened with.

File:getSize

Returns the file size.

size = File:getSize()

sizenumberThe file size in bytes.

File:isEOF

Gets whether end-of-file has been reached.

eof = File:isEOF()

eofbooleanWhether EOF has been reached.

File:isOpen

Gets whether the file is open.

open = File:isOpen()

openbooleanTrue if the file is currently open, false otherwise.

File:lines

Iterate over all the lines in a file.

iterator = File:lines()

iteratorfunctionThe iterator (can be used in for loops).

File:open

Open the file for write, read or append.

ok, err = File:open( mode )

okbooleanTrue on success, false otherwise.
errstringThe error string if an error occurred.
modeFileModeThe mode to open the file in.

File:read

Read a number of bytes from a file.

contents, size = File:read( bytes )

contentsstringThe contents of the read bytes.
sizenumberHow many bytes have been read.
bytes (all)numberThe number of bytes to read.

contents, size = File:read( container, bytes )

contentsvalueFileData or string containing the read bytes.
sizenumberHow many bytes have been read.
containerContainerTypeWhat type to return the file's contents as.
bytes (all)numberThe number of bytes to read.

File:seek

Seek to a position in a file

success = File:seek( pos )

successbooleanWhether the operation was successful
posnumberThe position to seek to

File:setBuffer

Sets the buffer mode for a file opened for writing or appending. Files with buffering enabled will not write data to the disk until the buffer size limit is reached, depending on the buffer mode.

File:flush will force any buffered data to be written to the disk.

success, errorstr = File:setBuffer( mode, size )

successbooleanWhether the buffer mode was successfully set.
errorstrstringThe error string, if the buffer mode could not be set and an error occurred.
modeBufferModeThe buffer mode to use.
size (0)numberThe maximum size in bytes of the file's buffer.

File:tell

Returns the position in the file.

pos = File:tell()

posnumberThe current position.

File:write

Write data to a file.

success, err = File:write( data, size )

successbooleanWhether the operation was successful.
errstringThe error string if an error occurred.
datastringThe string data to write.
size (all)numberHow many bytes to write.

success, errorstr = File:write( data, size )

successbooleanWhether the operation was successful.
errorstrstringThe error string if an error occurred.
dataDataThe Data object to write.
size (all)numberHow many bytes to write.

FileData:getExtension

Gets the extension of the FileData.

ext = FileData:getExtension()

extstringThe extension of the file the FileData represents.

FileData:getFilename

Gets the filename of the FileData.

name = FileData:getFilename()

namestringThe name of the file the FileData represents.

BufferMode

none

No buffering. The result of write and append operations appears immediately.

line

Line buffering. Write and append operations are buffered until a newline is output or the buffer size limit is reached.

full

Full buffering. Write and append operations are always buffered until the buffer size limit is reached.

FileDecoder

file

The data is unencoded.

base64

The data is base64-encoded.

FileMode

r

Open a file for read.

w

Open a file for write.

a

Open a file for append.

c

Do not open a file (represents a closed file.)

FileType

file

Regular file.

directory

Directory.

symlink

Symbolic link.

other

Something completely different like a device.

love.graphics

love.graphics.applyTransform

Applies the given Transform object to the current coordinate transformation.

This effectively multiplies the existing coordinate transformation's matrix with the Transform object's internal matrix to produce the new coordinate transformation.

love.graphics.applyTransform( transform )

transformTransformThe Transform object to apply to the current graphics coordinate transform.

love.graphics.arc

Draws a filled or unfilled arc at position (x, y). The arc is drawn from angle1 to angle2 in radians. The segments parameter determines how many segments are used to draw the arc. The more segments, the smoother the edge.

love.graphics.arc( drawmode, x, y, radius, angle1, angle2, segments )

drawmodeDrawModeHow to draw the arc.
xnumberThe position of the center along x-axis.
ynumberThe position of the center along y-axis.
radiusnumberRadius of the arc.
angle1numberThe angle at which the arc begins.
angle2numberThe angle at which the arc terminates.
segments (10)numberThe number of segments used for drawing the arc.

love.graphics.arc( drawmode, arctype, x, y, radius, angle1, angle2, segments )

drawmodeDrawModeHow to draw the arc.
arctypeArcTypeThe type of arc to draw.
xnumberThe position of the center along x-axis.
ynumberThe position of the center along y-axis.
radiusnumberRadius of the arc.
angle1numberThe angle at which the arc begins.
angle2numberThe angle at which the arc terminates.
segments (10)numberThe number of segments used for drawing the arc.

love.graphics.captureScreenshot

Creates a screenshot once the current frame is done (after love.draw has finished).

Since this function enqueues a screenshot capture rather than executing it immediately, it can be called from an input callback or love.update and it will still capture all of what's drawn to the screen in that frame.

love.graphics.captureScreenshot( filename )

filenamestringThe filename to save the screenshot to. The encoded image type is determined based on the extension of the filename, and must be one of the ImageFormats.

love.graphics.captureScreenshot( callback )

callbackfunctionFunction which gets called once the screenshot has been captured. An ImageData is passed into the function as its only argument.

love.graphics.captureScreenshot( channel )

channelChannelThe Channel to push the generated ImageData to.

love.graphics.circle

Draws a circle.

love.graphics.circle( mode, x, y, radius )

modeDrawModeHow to draw the circle.
xnumberThe position of the center along x-axis.
ynumberThe position of the center along y-axis.
radiusnumberThe radius of the circle.

love.graphics.circle( mode, x, y, radius, segments )

modeDrawModeHow to draw the circle.
xnumberThe position of the center along x-axis.
ynumberThe position of the center along y-axis.
radiusnumberThe radius of the circle.
segmentsnumberThe number of segments used for drawing the circle. Note: The default variable for the segments parameter varies between different versions of LÖVE.

love.graphics.clear

Clears the screen or active Canvas to the specified color.

This function is called automatically before love.draw in the default love.run function. See the example in love.run for a typical use of this function.

Note that the scissor area bounds the cleared region.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

In versions prior to background color instead.

love.graphics.clear()

love.graphics.clear( r, g, b, a, clearstencil, cleardepth )

rnumberThe red channel of the color to clear the screen to.
gnumberThe green channel of the color to clear the screen to.
bnumberThe blue channel of the color to clear the screen to.
a (1)numberThe alpha channel of the color to clear the screen to.
clearstencil (true)booleanWhether to clear the active stencil buffer, if present. It can also be an integer between 0 and 255 to clear the stencil buffer to a specific value.
cleardepth (true)booleanWhether to clear the active depth buffer, if present. It can also be a number between 0 and 1 to clear the depth buffer to a specific value.

love.graphics.clear( color, ..., clearstencil, cleardepth )

colortableA table in the form of {r, g, b, a} containing the color to clear the first active Canvas to.
...tableAdditional tables for each active Canvas.
clearstencil (true)booleanWhether to clear the active stencil buffer, if present. It can also be an integer between 0 and 255 to clear the stencil buffer to a specific value.
cleardepth (true)booleanWhether to clear the active depth buffer, if present. It can also be a number between 0 and 1 to clear the depth buffer to a specific value.

love.graphics.clear( clearcolor, clearstencil, cleardepth )

clearcolorbooleanWhether to clear the active color canvas to transparent black (0, 0, 0, 0). Typically this should be set to false with this variant of the function.
clearstencilbooleanWhether to clear the active stencil buffer, if present. It can also be an integer between 0 and 255 to clear the stencil buffer to a specific value.
cleardepthbooleanWhether to clear the active depth buffer, if present. It can also be a number between 0 and 1 to clear the depth buffer to a specific value.

love.graphics.discard

Discards (trashes) the contents of the screen or active Canvas. This is a performance optimization function with niche use cases.

If the active Canvas has just been changed and the 'replace' BlendMode is about to be used to draw something which covers the entire screen, calling love.graphics.discard rather than calling love.graphics.clear or doing nothing may improve performance on mobile devices.

On some desktop systems this function may do nothing.

love.graphics.discard( discardcolor, discardstencil )

discardcolor (true)booleanWhether to discard the texture(s) of the active Canvas(es) (the contents of the screen if no Canvas is active.)
discardstencil (true)booleanWhether to discard the contents of the stencil buffer of the screen / active Canvas.

love.graphics.discard( discardcolors, discardstencil )

discardcolorstableAn array containing boolean values indicating whether to discard the texture of each active Canvas, when multiple simultaneous Canvases are active.
discardstencil (true)booleanWhether to discard the contents of the stencil buffer of the screen / active Canvas.

love.graphics.draw

Draws a Drawable object (an Image, Canvas, SpriteBatch, ParticleSystem, Mesh, Text object, or Video) on the screen with optional rotation, scaling and shearing.

Objects are drawn relative to their local coordinate system. The origin is by default located at the top left corner of Image and Canvas. All scaling, shearing, and rotation arguments transform the object relative to that point. Also, the position of the origin can be specified on the screen coordinate system.

It's possible to rotate an object about its center by offsetting the origin to the center. Angles must be given in radians for rotation. One can also use a negative scaling factor to flip about its centerline.

Note that the offsets are applied before rotation, scaling, or shearing; scaling and shearing are applied before rotation.

The right and bottom edges of the object are shifted at an angle defined by the shearing factors.

When using the default shader anything drawn with this function will be tinted according to the currently selected color. Set it to pure white to preserve the object's original colors.

love.graphics.draw( drawable, x, y, r, sx, sy, ox, oy, kx, ky )

drawableDrawableA drawable object.
x (0)numberThe position to draw the object (x-axis).
y (0)numberThe position to draw the object (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

love.graphics.draw( texture, quad, x, y, r, sx, sy, ox, oy, kx, ky )

textureTextureA Texture (Image or Canvas) to texture the Quad with.
quadQuadThe Quad to draw on screen.
xnumberThe position to draw the object (x-axis).
ynumberThe position to draw the object (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

love.graphics.draw( drawable, transform )

drawableDrawableA drawable object.
transformTransformTransformation object.

love.graphics.draw( texture, quad, transform )

textureTextureA Texture (Image or Canvas) to texture the Quad with.
quadQuadThe Quad to draw on screen.
transformTransformTransformation object.

love.graphics.drawInstanced

Draws many instances of a Mesh with a single draw call, using hardware geometry instancing.

Each instance can have unique properties (positions, colors, etc.) but will not by default unless a custom per-instance vertex attributes or the love_InstanceID GLSL 3 vertex shader variable is used, otherwise they will all render at the same position on top of each other.

Instancing is not supported by some older GPUs that are only capable of using OpenGL ES 2 or OpenGL 2. Use love.graphics.getSupported to check.

love.graphics.drawInstanced( mesh, instancecount, x, y, r, sx, sy, ox, oy, kx, ky )

meshMeshThe mesh to render.
instancecountnumberThe number of instances to render.
x (0)numberThe position to draw the instances (x-axis).
y (0)numberThe position to draw the instances (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

love.graphics.drawInstanced( mesh, instancecount, transform )

meshMeshThe mesh to render.
instancecountnumberThe number of instances to render.
transformTransformA transform object.

love.graphics.drawLayer

Draws a layer of an Array Texture.

love.graphics.drawLayer( texture, layerindex, x, y, r, sx, sy, ox, oy, kx, ky )

textureTextureThe Array Texture to draw.
layerindexnumberThe index of the layer to use when drawing.
x (0)numberThe position to draw the texture (x-axis).
y (0)numberThe position to draw the texture (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

love.graphics.drawLayer( texture, layerindex, quad, x, y, r, sx, sy, ox, oy, kx, ky )

textureTextureThe Array Texture to draw.
layerindexnumberThe index of the layer to use when drawing.
quadQuadThe subsection of the texture's layer to use when drawing.
x (0)numberThe position to draw the texture (x-axis).
y (0)numberThe position to draw the texture (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

love.graphics.drawLayer( texture, layerindex, transform )

textureTextureThe Array Texture to draw.
layerindexnumberThe index of the layer to use when drawing.
transformTransformA transform object.

love.graphics.drawLayer( texture, layerindex, quad, transform )

textureTextureThe Array Texture to draw.
layerindexnumberThe index of the layer to use when drawing.
quadQuadThe subsection of the texture's layer to use when drawing.
transformTransformA transform object.

love.graphics.ellipse

Draws an ellipse.

love.graphics.ellipse( mode, x, y, radiusx, radiusy )

modeDrawModeHow to draw the ellipse.
xnumberThe position of the center along x-axis.
ynumberThe position of the center along y-axis.
radiusxnumberThe radius of the ellipse along the x-axis (half the ellipse's width).
radiusynumberThe radius of the ellipse along the y-axis (half the ellipse's height).

love.graphics.ellipse( mode, x, y, radiusx, radiusy, segments )

modeDrawModeHow to draw the ellipse.
xnumberThe position of the center along x-axis.
ynumberThe position of the center along y-axis.
radiusxnumberThe radius of the ellipse along the x-axis (half the ellipse's width).
radiusynumberThe radius of the ellipse along the y-axis (half the ellipse's height).
segmentsnumberThe number of segments used for drawing the ellipse.

love.graphics.flushBatch

Immediately renders any pending automatically batched draws.

LÖVE will call this function internally as needed when most state is changed, so it is not necessary to manually call it.

The current batch will be automatically flushed by color), as well as Shader:send and methods on Textures which change their state. Using a different Image in consecutive love.graphics.draw calls will also flush the current batch.

SpriteBatches, ParticleSystems, Meshes, and Text objects do their own batching and do not affect automatic batching of other draws, aside from flushing the current batch when they're drawn.

love.graphics.flushBatch()

love.graphics.getBackgroundColor

Gets the current background color.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

r, g, b, a = love.graphics.getBackgroundColor()

rnumberThe red component (0-1).
gnumberThe green component (0-1).
bnumberThe blue component (0-1).
anumberThe alpha component (0-1).

love.graphics.getBlendMode

Gets the blending mode.

mode, alphamode = love.graphics.getBlendMode()

modeBlendModeThe current blend mode.
alphamodeBlendAlphaModeThe current blend alpha mode – it determines how the alpha of drawn objects affects blending.

love.graphics.getCanvas

Gets the current target Canvas.

canvas = love.graphics.getCanvas()

canvasCanvasThe Canvas set by setCanvas. Returns nil if drawing to the real screen.

love.graphics.getCanvasFormats

Gets the available Canvas formats, and whether each is supported.

formats = love.graphics.getCanvasFormats()

formatstableA table containing CanvasFormats as keys, and a boolean indicating whether the format is supported as values. Not all systems support all formats.

formats = love.graphics.getCanvasFormats( readable )

formatstableA table containing CanvasFormats as keys, and a boolean indicating whether the format is supported as values (taking into account the readable parameter). Not all systems support all formats.
readablebooleanIf true, the returned formats will only be indicated as supported if readable flag set to true for that format, and vice versa if the parameter is false.

love.graphics.getColor

Gets the current color.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

r, g, b, a = love.graphics.getColor()

rnumberThe red component (0-1).
gnumberThe green component (0-1).
bnumberThe blue component (0-1).
anumberThe alpha component (0-1).

love.graphics.getColorMask

Gets the active color components used when drawing. Normally all 4 components are active unless love.graphics.setColorMask has been used.

The color mask determines whether individual components of the colors of drawn objects will affect the color of the screen. They affect love.graphics.clear and Canvas:clear as well.

r, g, b, a = love.graphics.getColorMask()

rbooleanWhether the red color component is active when rendering.
gbooleanWhether the green color component is active when rendering.
bbooleanWhether the blue color component is active when rendering.
abooleanWhether the alpha color component is active when rendering.

love.graphics.getDPIScale

Gets the DPI scale factor of the window.

The DPI scale factor represents relative pixel density. 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.graphics.getDPIScale() would return 2 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.graphics.getDPIScale()

scalenumberThe pixel scale factor associated with the window.

love.graphics.getDefaultFilter

Returns the default scaling filters used with Images, Canvases, and Fonts.

min, mag, anisotropy = love.graphics.getDefaultFilter()

minFilterModeFilter mode used when scaling the image down.
magFilterModeFilter mode used when scaling the image up.
anisotropynumberMaximum amount of Anisotropic Filtering used.

love.graphics.getDepthMode

Gets the current depth test mode and whether writing to the depth buffer is enabled.

This is low-level functionality designed for use with custom vertex shaders and Meshes with custom vertex attributes. No higher level APIs are provided to set the depth of 2D graphics such as shapes, lines, and Images.

comparemode, write = love.graphics.getDepthMode()

comparemodeCompareModeDepth comparison mode used for depth testing.
writebooleanWhether to write update / write values to the depth buffer when rendering.

love.graphics.getDimensions

Gets the width and height in pixels of the window.

width, height = love.graphics.getDimensions()

widthnumberThe width of the window.
heightnumberThe height of the window.

love.graphics.getFont

Gets the current Font object.

font = love.graphics.getFont()

fontFontThe current Font. Automatically creates and sets the default font, if none is set yet.

love.graphics.getFrontFaceWinding

Gets whether triangles with clockwise- or counterclockwise-ordered vertices are considered front-facing.

This is designed for use in combination with Mesh face culling. Other love.graphics shapes, lines, and sprites are not guaranteed to have a specific winding order to their internal vertices.

winding = love.graphics.getFrontFaceWinding()

windingVertexWindingThe winding mode being used. The default winding is counterclockwise ('ccw').

love.graphics.getHeight

Gets the height in pixels of the window.

height = love.graphics.getHeight()

heightnumberThe height of the window.

love.graphics.getImageFormats

Gets the raw and compressed pixel formats usable for Images, and whether each is supported.

formats = love.graphics.getImageFormats()

formatstableA table containing PixelFormats as keys, and a boolean indicating whether the format is supported as values. Not all systems support all formats.

love.graphics.getLineJoin

Gets the line join style.

join = love.graphics.getLineJoin()

joinLineJoinThe LineJoin style.

love.graphics.getLineStyle

Gets the line style.

style = love.graphics.getLineStyle()

styleLineStyleThe current line style.

love.graphics.getLineWidth

Gets the current line width.

width = love.graphics.getLineWidth()

widthnumberThe current line width.

love.graphics.getMeshCullMode

Gets whether back-facing triangles in a Mesh are culled.

Mesh face culling is designed for use with low level custom hardware-accelerated 3D rendering via custom vertex attributes on Meshes, custom vertex shaders, and depth testing with a depth buffer.

mode = love.graphics.getMeshCullMode()

modeCullModeThe Mesh face culling mode in use (whether to render everything, cull back-facing triangles, or cull front-facing triangles).

love.graphics.getPixelHeight

Gets the height in pixels of the window.

The graphics coordinate system and DPI scale factor, rather than raw pixels. Use getHeight for calculations related to drawing to the screen and using the coordinate system (calculating the center of the screen, for example), and getPixelHeight only when dealing specifically with underlying pixels (pixel-related calculations in a pixel Shader, for example).

pixelheight = love.graphics.getPixelHeight()

pixelheightnumberThe height of the window in pixels.

love.graphics.getPixelWidth

Gets the width in pixels of the window.

The graphics coordinate system and DPI scale factor, rather than raw pixels. Use getWidth for calculations related to drawing to the screen and using the coordinate system (calculating the center of the screen, for example), and getPixelWidth only when dealing specifically with underlying pixels (pixel-related calculations in a pixel Shader, for example).

pixelwidth = love.graphics.getPixelWidth()

pixelwidthnumberThe width of the window in pixels.

love.graphics.getPointSize

Gets the point size.

size = love.graphics.getPointSize()

sizenumberThe current point size.

love.graphics.getRendererInfo

Gets information about the system's video card and drivers.

name, version, vendor, device = love.graphics.getRendererInfo()

namestringThe name of the renderer, e.g. 'OpenGL' or 'OpenGL ES'.
versionstringThe version of the renderer with some extra driver-dependent version info, e.g. '2.1 INTEL-8.10.44'.
vendorstringThe name of the graphics card vendor, e.g. 'Intel Inc'.
devicestringThe name of the graphics card, e.g. 'Intel HD Graphics 3000 OpenGL Engine'.

love.graphics.getScissor

Gets the current scissor box.

x, y, width, height = love.graphics.getScissor()

xnumberThe x-component of the top-left point of the box.
ynumberThe y-component of the top-left point of the box.
widthnumberThe width of the box.
heightnumberThe height of the box.

love.graphics.getShader

Gets the current Shader. Returns nil if none is set.

shader = love.graphics.getShader()

shaderShaderThe currently active Shader, or nil if none is set.

love.graphics.getStackDepth

Gets the current depth of the transform / state stack (the number of pushes without corresponding pops).

depth = love.graphics.getStackDepth()

depthnumberThe current depth of the transform and state love.graphics stack.

love.graphics.getStats

Gets performance-related rendering statistics.

stats = love.graphics.getStats()

statstableA table with the following fields:
stats.drawcallsnumberThe number of draw calls made so far during the current frame.
stats.canvasswitchesnumberThe number of times the active Canvas has been switched so far during the current frame.
stats.texturememorynumberThe estimated total size in bytes of video memory used by all loaded Images, Canvases, and Fonts.
stats.imagesnumberThe number of Image objects currently loaded.
stats.canvasesnumberThe number of Canvas objects currently loaded.
stats.fontsnumberThe number of Font objects currently loaded.
stats.shaderswitchesnumberThe number of times the active Shader has been changed so far during the current frame.
stats.drawcallsbatchednumberThe number of draw calls that were saved by LÖVE's automatic batching, since the start of the frame.

love.graphics.getStencilTest

Gets the current stencil test configuration.

When stencil testing is enabled, the geometry of everything that is drawn afterward will be clipped / stencilled out based on a comparison between the arguments of this function and the stencil value of each pixel that the geometry touches. The stencil values of pixels are affected via love.graphics.stencil.

Each Canvas has its own per-pixel stencil values.

comparemode, comparevalue = love.graphics.getStencilTest()

comparemodeCompareModeThe type of comparison that is made for each pixel. Will be 'always' if stencil testing is disabled.
comparevaluenumberThe value used when comparing with the stencil value of each pixel.

love.graphics.getSupported

Gets the optional graphics features and whether they're supported on the system.

Some older or low-end systems don't always support all graphics features.

features = love.graphics.getSupported()

featurestableA table containing GraphicsFeature keys, and boolean values indicating whether each feature is supported.

love.graphics.getSystemLimits

Gets the system-dependent maximum values for love.graphics features.

limits = love.graphics.getSystemLimits()

limitstableA table containing GraphicsLimit keys, and number values.

love.graphics.getTextureTypes

Gets the available texture types, and whether each is supported.

texturetypes = love.graphics.getTextureTypes()

texturetypestableA table containing TextureTypes as keys, and a boolean indicating whether the type is supported as values. Not all systems support all types.

love.graphics.getWidth

Gets the width in pixels of the window.

width = love.graphics.getWidth()

widthnumberThe width of the window.

love.graphics.intersectScissor

Sets the scissor to the rectangle created by the intersection of the specified rectangle with the existing scissor. If no scissor is active yet, it behaves like love.graphics.setScissor.

The scissor limits the drawing area to a specified rectangle. This affects all graphics calls, including love.graphics.clear.

The dimensions of the scissor is unaffected by graphical transformations (translate, scale, ...).

love.graphics.intersectScissor( x, y, width, height )

xnumberThe x-coordinate of the upper left corner of the rectangle to intersect with the existing scissor rectangle.
ynumberThe y-coordinate of the upper left corner of the rectangle to intersect with the existing scissor rectangle.
widthnumberThe width of the rectangle to intersect with the existing scissor rectangle.
heightnumberThe height of the rectangle to intersect with the existing scissor rectangle.

love.graphics.inverseTransformPoint

Converts the given 2D position from screen-space into global coordinates.

This effectively applies the reverse of the current graphics transformations to the given position. A similar Transform:inverseTransformPoint method exists for Transform objects.

globalX, globalY = love.graphics.inverseTransformPoint( screenX, screenY )

globalXnumberThe x component of the position in global coordinates.
globalYnumberThe y component of the position in global coordinates.
screenXnumberThe x component of the screen-space position.
screenYnumberThe y component of the screen-space position.

love.graphics.isGammaCorrect

Gets whether gamma-correct rendering is supported and enabled. It can be enabled by setting t.gammacorrect = true in love.conf.

Not all devices support gamma-correct rendering, in which case it will be automatically disabled and this function will return false. It is supported on desktop systems which have graphics cards that are capable of using OpenGL 3 / DirectX 10, and iOS devices that can use OpenGL ES 3.

gammacorrect = love.graphics.isGammaCorrect()

gammacorrectbooleanTrue if gamma-correct rendering is supported and was enabled in love.conf, false otherwise.

love.graphics.isWireframe

Gets whether wireframe mode is used when drawing.

wireframe = love.graphics.isWireframe()

wireframebooleanTrue if wireframe lines are used when drawing, false if it's not.

love.graphics.line

Draws lines between points.

love.graphics.line( x1, y1, x2, y2, ... )

x1numberThe position of first point on the x-axis.
y1numberThe position of first point on the y-axis.
x2numberThe position of second point on the x-axis.
y2numberThe position of second point on the y-axis.
...numberYou can continue passing point positions to draw a polyline.

love.graphics.line( points )

pointstableA table of point positions, as described above.

love.graphics.newArrayImage

Creates a new array Image.

An array image / array texture is a single object which contains multiple 'layers' or 'slices' of 2D sub-images. It can be thought of similarly to a texture atlas or sprite sheet, but it doesn't suffer from the same tile / quad bleeding artifacts that texture atlases do – although every sub-image must have the same dimensions.

A specific layer of an array image can be drawn with love.graphics.drawLayer / SpriteBatch:addLayer, or with the Quad variant of love.graphics.draw and Quad:setLayer, or via a custom Shader.

To use an array image in a Shader, it must be declared as a ArrayImage or sampler2DArray type (instead of Image or sampler2D). The Texel(ArrayImage image, vec3 texturecoord) shader function must be used to get pixel colors from a slice of the array image. The vec3 argument contains the texture coordinate in the first two components, and the 0-based slice index in the third component.

image = love.graphics.newArrayImage( slices, settings )

imageImageAn Array Image object.
slicestableA table containing filepaths to images (or File, FileData, ImageData, or CompressedImageData objects), in an array. Each sub-image must have the same dimensions. A table of tables can also be given, where each sub-table contains all mipmap levels for the slice index of that sub-table.
settings (nil)tableOptional table of settings to configure the array image, containing the following fields:
settings.mipmaps (false)booleanTrue to make the image use mipmaps, false to disable them. Mipmaps will be automatically generated if the image isn't a compressed texture format.
settings.linear (false)booleanTrue to treat the image's pixels as linear instead of sRGB, when gamma correct rendering is enabled. Most images are authored as sRGB.
settings.dpiscale (1)numberThe DPI scale to use when drawing the array image and calling getWidth/getHeight.

love.graphics.newCanvas

Creates a new Canvas object for offscreen rendering.

canvas = love.graphics.newCanvas()

canvasCanvasA new Canvas with dimensions equal to the window's size in pixels.

canvas = love.graphics.newCanvas( width, height )

canvasCanvasA new Canvas with specified width and height.
widthnumberThe desired width of the Canvas.
heightnumberThe desired height of the Canvas.

canvas = love.graphics.newCanvas( width, height, settings )

canvasCanvasA new Canvas with specified width and height.
widthnumberThe desired width of the Canvas.
heightnumberThe desired height of the Canvas.
settingstableA table containing the given fields:
settings.type ('2d')TextureTypeThe type of Canvas to create.
settings.format ('normal')PixelFormatThe format of the Canvas.
settings.readablebooleanWhether the Canvas is readable (drawable and accessible in a Shader). True by default for regular formats, false by default for depth/stencil formats.
settings.msaa (0)numberThe desired number of multisample antialiasing (MSAA) samples used when drawing to the Canvas.
settings.dpiscale (love.graphics.getDPIScale())numberThe DPI scale factor of the Canvas, used when drawing to the Canvas as well as when drawing the Canvas to the screen.
settings.mipmaps ('none')CanvasMipmapModeWhether the Canvas has mipmaps, and whether to automatically regenerate them if so.

canvas = love.graphics.newCanvas( width, height, layers, settings )

canvasCanvasA new Canvas with specified width and height.
widthnumberThe desired width of the Canvas.
heightnumberThe desired height of the Canvas.
layersnumberThe number of array layers (if the Canvas is an Array Texture), or the volume depth (if the Canvas is a Volume Texture).
settingstableA table containing the given fields:
settings.type ('array')TextureTypeThe type of Canvas to create.
settings.format ('normal')PixelFormatThe format of the Canvas.
settings.readablebooleanWhether the Canvas is readable (drawable and accessible in a Shader). True by default for regular formats, false by default for depth/stencil formats.
settings.msaa (0)numberThe desired number of multisample antialiasing (MSAA) samples used when drawing to the Canvas.
settings.dpiscale (love.graphics.getDPIScale())numberThe DPI scale factor of the Canvas, used when drawing to the Canvas as well as when drawing the Canvas to the screen.
settings.mipmaps ('none')CanvasMipmapModeWhether the Canvas has mipmaps, and whether to automatically regenerate them if so.

canvas = love.graphics.newCanvas( width, height, format )

canvasCanvasA new Canvas with specified width and height.
width (window_width)numberThe desired width of the Canvas.
height (window_height)numberThe desired height of the Canvas.
format ('normal')CanvasFormatThe desired texture format of the Canvas.

canvas = love.graphics.newCanvas( width, height, format, msaa )

canvasCanvasA new Canvas with specified width and height.
width (window_width)numberThe desired width of the Canvas.
height (window_height)numberThe desired height of the Canvas.
format ('normal')CanvasFormatThe desired texture format of the Canvas.
msaa (0)numberThe desired number of multisample antialiasing (MSAA) samples used when drawing to the Canvas.

love.graphics.newCubeImage

Creates a new cubemap Image.

Cubemap images have 6 faces (sides) which represent a cube. They can't be rendered directly, they can only be used in Shader code (and sent to the shader via Shader:send).

To use a cubemap image in a Shader, it must be declared as a CubeImage or samplerCube type (instead of Image or sampler2D). The Texel(CubeImage image, vec3 direction) shader function must be used to get pixel colors from the cubemap. The vec3 argument is a normalized direction from the center of the cube, rather than explicit texture coordinates.

Each face in a cubemap image must have square dimensions.

For variants of this function which accept a single image containing multiple cubemap faces, they must be laid out in one of the following forms in the image:

+y

+z +x -z

-y

-x

or:

+y

-x +z +x -z

-y

or:

+x

-x

+y

-y

+z

-z

or:

+x -x +y -y +z -z

image = love.graphics.newCubeImage( filename, settings )

imageImageAn cubemap Image object.
filenamestringThe filepath to a cubemap image file (or a File, FileData, or ImageData).
settings (nil)tableOptional table of settings to configure the cubemap image, containing the following fields:
settings.mipmaps (false)booleanTrue to make the image use mipmaps, false to disable them. Mipmaps will be automatically generated if the image isn't a compressed texture format.
settings.linear (false)booleanTrue to treat the image's pixels as linear instead of sRGB, when gamma correct rendering is enabled. Most images are authored as sRGB.

image = love.graphics.newCubeImage( faces, settings )

imageImageAn cubemap Image object.
facestableA table containing 6 filepaths to images (or File, FileData, ImageData, or CompressedImageData objects), in an array. Each face image must have the same dimensions. A table of tables can also be given, where each sub-table contains all mipmap levels for the cube face index of that sub-table.
settings (nil)tableOptional table of settings to configure the cubemap image, containing the following fields:
settings.mipmaps (false)booleanTrue to make the image use mipmaps, false to disable them. Mipmaps will be automatically generated if the image isn't a compressed texture format.
settings.linear (false)booleanTrue to treat the image's pixels as linear instead of sRGB, when gamma correct rendering is enabled. Most images are authored as sRGB.

love.graphics.newFont

Creates a new Font from a TrueType Font or BMFont file. Created fonts are not cached, in that calling this function with the same arguments will always create a new Font object.

All variants which accept a filename can also accept a Data object instead.

font = love.graphics.newFont( filename )

fontFontA Font object which can be used to draw text on screen.
filenamestringThe filepath to the BMFont or TrueType font file.

font = love.graphics.newFont( filename, size, hinting )

fontFontA Font object which can be used to draw text on screen.
filenamestringThe filepath to the TrueType font file.
sizenumberThe size of the font in pixels.
hinting ('normal')HintingModeTrue Type hinting mode.

font = love.graphics.newFont( filename, imagefilename )

fontFontA Font object which can be used to draw text on screen.
filenamestringThe filepath to the BMFont file.
imagefilenamestringThe filepath to the BMFont's image file. If this argument is omitted, the path specified inside the BMFont file will be used.

font = love.graphics.newFont( size, hinting )

fontFontA Font object which can be used to draw text on screen.
size (12)numberThe size of the font in pixels.
hinting ('normal')HintingModeTrue Type hinting mode.

love.graphics.newImage

Creates a new Image from a filepath, FileData, an ImageData, or a CompressedImageData, and optionally generates or specifies mipmaps for the image.

image = love.graphics.newImage( filename )

imageImageAn Image object which can be drawn on screen.
filenamestringThe filepath to the image file.

image = love.graphics.newImage( imageData )

imageImageAn Image object which can be drawn on screen.
imageDataImageDataAn ImageData object. The Image will use this ImageData to reload itself when love.window.setMode is called.

image = love.graphics.newImage( compressedImageData )

imageImageAn Image object which can be drawn on screen.
compressedImageDataCompressedImageDataA CompressedImageData object. The Image will use this CompressedImageData to reload itself when love.window.setMode is called.

image = love.graphics.newImage( filename, flags )

imageImageA new Image object which can be drawn on screen.
filenamestringThe filepath to the image file (or a FileData or ImageData or CompressedImageData object).
flagstableA table containing the following fields:
flags.linear (false)booleanTrue if the image's pixels should be interpreted as being linear RGB rather than sRGB-encoded, if gamma-correct rendering is enabled. Has no effect otherwise.
flags.mipmaps (false)boolean or tableIf true, mipmaps for the image will be automatically generated (or taken from the images's file if possible, if the image originated from a CompressedImageData). If this value is a table, it should contain a list of other filenames of images of the same format that have progressively half-sized dimensions, all the way down to 1x1. Those images will be used as this Image's mipmap levels.

image = love.graphics.newImage( filename, format )

imageImageAn Image object which can be drawn on screen.
filenamestringThe filepath to the image file (or a FileData or ImageData or CompressedImageData object.)
formatTextureFormatThe format to interpret the image's data as.

love.graphics.newImageFont

Creates a new specifically formatted image.

In versions prior to 0.9.0, LÖVE expects ISO 8859-1 encoding for the glyphs string.

font = love.graphics.newImageFont( filename, glyphs )

fontFontA Font object which can be used to draw text on screen.
filenamestringThe filepath to the image file.
glyphsstringA string of the characters in the image in order from left to right.

font = love.graphics.newImageFont( imageData, glyphs )

fontFontA Font object which can be used to draw text on screen.
imageDataImageDataThe ImageData object to create the font from.
glyphsstringA string of the characters in the image in order from left to right.

font = love.graphics.newImageFont( filename, glyphs, extraspacing )

fontFontA Font object which can be used to draw text on screen.
filenamestringThe filepath to the image file.
glyphsstringA string of the characters in the image in order from left to right.
extraspacingnumberAdditional spacing (positive or negative) to apply to each glyph in the Font.

love.graphics.newMesh

Creates a new Mesh.

Use Mesh:setTexture if the Mesh should be textured with an Image or Canvas when it's drawn.

In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.

mesh = love.graphics.newMesh( vertices, mode, usage )

meshMeshThe new mesh.
verticestableThe table filled with vertex information tables for each vertex as follows:
vertices.1numberThe position of the vertex on the x-axis.
vertices.2numberThe position of the vertex on the y-axis.
vertices.3 (0)numberThe u texture coordinate of the vertex. Texture coordinates are normally in the range of 1, but can be greater or less (see WrapMode.)
vertices.4 (0)numberThe v texture coordinate of the vertex. Texture coordinates are normally in the range of 1, but can be greater or less (see WrapMode.)
vertices.5 (1)numberThe red component of the vertex color.
vertices.6 (1)numberThe green component of the vertex color.
vertices.7 (1)numberThe blue component of the vertex color.
vertices.8 (1)numberThe alpha component of the vertex color.
mode ('fan')MeshDrawModeHow the vertices are used when drawing. The default mode 'fan' is sufficient for simple convex polygons.
usage ('dynamic')SpriteBatchUsageThe expected usage of the Mesh. The specified usage mode affects the Mesh's memory usage and performance.

mesh = love.graphics.newMesh( vertexcount, mode, usage )

meshMeshThe new mesh.
vertexcountnumberThe total number of vertices the Mesh will use. Each vertex is initialized to {0,0, 0,0, 1,1,1,1}.
mode ('fan')MeshDrawModeHow the vertices are used when drawing. The default mode 'fan' is sufficient for simple convex polygons.
usage ('dynamic')SpriteBatchUsageThe expected usage of the Mesh. The specified usage mode affects the Mesh's memory usage and performance.

mesh = love.graphics.newMesh( vertexformat, vertices, mode, usage )

meshMeshThe new mesh.
vertexformattableA table in the form of {attribute, ...}. Each attribute is a table which specifies a custom vertex attribute used for each vertex.
vertexformat.attributetableA table containing the attribute's name, it's data type, and the number of components in the attribute, in the form of {name, datatype, components}.
vertexformat....tableAdditional vertex attribute format tables.
verticestableThe table filled with vertex information tables for each vertex, in the form of {vertex, ...} where each vertex is a table in the form of {attributecomponent, ...}.
vertices.attributecomponentnumberThe first component of the first vertex attribute in the vertex.
vertices....numberAdditional components of all vertex attributes in the vertex.
mode ('fan')MeshDrawModeHow the vertices are used when drawing. The default mode 'fan' is sufficient for simple convex polygons.
usage ('dynamic')SpriteBatchUsageThe expected usage of the Mesh. The specified usage mode affects the Mesh's memory usage and performance.

mesh = love.graphics.newMesh( vertexformat, vertexcount, mode, usage )

meshMeshThe new mesh.
vertexformattableA table in the form of {attribute, ...}. Each attribute is a table which specifies a custom vertex attribute used for each vertex.
vertexformat.attributetableA table containing the attribute's name, it's data type, and the number of components in the attribute, in the form of {name, datatype, components}.
vertexformat....tableAdditional vertex attribute format tables.
vertexcountnumberThe total number of vertices the Mesh will use.
mode ('fan')MeshDrawModeHow the vertices are used when drawing. The default mode 'fan' is sufficient for simple convex polygons.
usage ('dynamic')SpriteBatchUsageThe expected usage of the Mesh. The specified usage mode affects the Mesh's memory usage and performance.

mesh = love.graphics.newMesh( vertexcount, texture, mode )

meshMeshThe new mesh.
vertexcountnumberThe total number of vertices the Mesh will use. Each vertex is initialized to {0,0, 0,0, 255,255,255,255}.
texture (nil)TextureThe Image or Canvas to use when drawing the Mesh. May be nil to use no texture.
mode ('fan')MeshDrawModeHow the vertices are used when drawing. The default mode 'fan' is sufficient for simple convex polygons.

love.graphics.newParticleSystem

Creates a new ParticleSystem.

system = love.graphics.newParticleSystem( image, buffer )

systemParticleSystemA new ParticleSystem.
imageImageThe image to use.
buffer (1000)numberThe max number of particles at the same time.

system = love.graphics.newParticleSystem( texture, buffer )

systemParticleSystemA new ParticleSystem.
textureTextureThe texture (Image or Canvas) to use.
buffer (1000)numberThe max number of particles at the same time.

love.graphics.newQuad

Creates a new Quad.

The purpose of a Quad is to use a fraction of an image to draw objects, as opposed to drawing entire image. It is most useful for sprite sheets and atlases: in a sprite atlas, multiple sprites reside in same image, quad is used to draw a specific sprite from that image; in animated sprites with all frames residing in the same image, quad is used to draw specific frame from the animation.

quad = love.graphics.newQuad( x, y, width, height, sw, sh )

quadQuadThe new Quad.
xnumberThe top-left position in the Image along the x-axis.
ynumberThe top-left position in the Image along the y-axis.
widthnumberThe width of the Quad in the Image. (Must be greater than 0.)
heightnumberThe height of the Quad in the Image. (Must be greater than 0.)
swnumberThe reference width, the width of the Image. (Must be greater than 0.)
shnumberThe reference height, the height of the Image. (Must be greater than 0.)

love.graphics.newShader

Creates a new Shader object for hardware-accelerated vertex and pixel effects. A Shader contains either vertex shader code, pixel shader code, or both.

Shaders are small programs which are run on the graphics card when drawing. Vertex shaders are run once for each vertex (for example, an image has 4 vertices - one at each corner. A Mesh might have many more.) Pixel shaders are run once for each pixel on the screen which the drawn object touches. Pixel shader code is executed after all the object's vertices have been processed by the vertex shader.

shader = love.graphics.newShader( code )

shaderShaderA Shader object for use in drawing operations.
codestringThe pixel shader or vertex shader code, or a filename pointing to a file with the code.

output_pos = love.graphics.newShader( transform_projection, vertex_position )

output_posvec4The final transformed position of the current vertex.
transform_projectionmat4The transformation matrix affected by love.graphics.translate and friends combined with the orthographic projection matrix.
vertex_positionvec4The raw un-transformed position of the current vertex.

love.graphics.newSpriteBatch

Creates a new SpriteBatch object.

spriteBatch = love.graphics.newSpriteBatch( image, maxsprites )

spriteBatchSpriteBatchThe new SpriteBatch.
imageImageThe Image to use for the sprites.
maxsprites (1000)numberThe maximum number of sprites that the SpriteBatch can contain at any given time. Since version 11.0, additional sprites added past this number will automatically grow the spritebatch.

spriteBatch = love.graphics.newSpriteBatch( image, maxsprites, usage )

spriteBatchSpriteBatchThe new SpriteBatch.
imageImageThe Image to use for the sprites.
maxsprites (1000)numberThe maximum number of sprites that the SpriteBatch can contain at any given time. Since version 11.0, additional sprites added past this number will automatically grow the spritebatch.
usage ('dynamic')SpriteBatchUsageThe expected usage of the SpriteBatch. The specified usage mode affects the SpriteBatch's memory usage and performance.

spriteBatch = love.graphics.newSpriteBatch( texture, maxsprites, usage )

spriteBatchSpriteBatchThe new SpriteBatch.
textureTextureThe Image or Canvas to use for the sprites.
maxsprites (1000)numberThe maximum number of sprites that the SpriteBatch can contain at any given time. Since version 11.0, additional sprites added past this number will automatically grow the spritebatch.
usage ('dynamic')SpriteBatchUsageThe expected usage of the SpriteBatch. The specified usage mode affects the SpriteBatch's memory usage and performance.

love.graphics.newText

Creates a new drawable Text object.

text = love.graphics.newText( font, textstring )

textTextThe new drawable Text object.
fontFontThe font to use for the text.
textstring (nil)stringThe initial string of text that the new Text object will contain. May be nil.

love.graphics.newVideo

Creates a new drawable Video. Currently only Ogg Theora video files are supported.

video = love.graphics.newVideo( filename )

videoVideoA new Video.
filenamestringThe file path to the Ogg Theora video file.

video = love.graphics.newVideo( videostream )

videoVideoA new Video.
videostreamVideoStreamA video stream object.

video = love.graphics.newVideo( filename, settings )

videoVideoA new Video.
filenamestringThe file path to the Ogg Theora video file (or VideoStream).
settingstableA table containing the following fields:
settings.audio (false)booleanWhether to try to load the video's audio into an audio Source. If not explicitly set to true or false, it will try without causing an error if the video has no audio.
settings.dpiscale (love.graphics.getDPIScale())numberThe DPI scale factor of the video.

video = love.graphics.newVideo( filename, loadaudio )

videoVideoA new Video.
filenamestringThe file path to the Ogg Theora video file.
loadaudio (nil)booleanWhether to try to load the video's audio into an audio Source. If not explicitly set to true or false, it will try without causing an error if the video has no audio.

video = love.graphics.newVideo( videostream, loadaudio )

videoVideoA new Video.
videostreamVideoStreamA video stream object.
loadaudio (nil)booleanWhether to try to load the video's audio into an audio Source. If not explicitly set to true or false, it will try without causing an error if the video has no audio.

love.graphics.newVolumeImage

Creates a new volume (3D) Image.

Volume images are 3D textures with width, height, and depth. They can't be rendered directly, they can only be used in Shader code (and sent to the shader via Shader:send).

To use a volume image in a Shader, it must be declared as a VolumeImage or sampler3D type (instead of Image or sampler2D). The Texel(VolumeImage image, vec3 texcoords) shader function must be used to get pixel colors from the volume image. The vec3 argument is a normalized texture coordinate with the z component representing the depth to sample at (ranging from 1).

Volume images are typically used as lookup tables in shaders for color grading, for example, because sampling using a texture coordinate that is partway in between two pixels can interpolate across all 3 dimensions in the volume image, resulting in a smooth gradient even when a small-sized volume image is used as the lookup table.

Array images are a much better choice than volume images for storing multiple different sprites in a single array image for directly drawing them.

image = love.graphics.newVolumeImage( layers, settings )

imageImageA volume Image object.
layerstableA table containing filepaths to images (or File, FileData, ImageData, or CompressedImageData objects), in an array. A table of tables can also be given, where each sub-table represents a single mipmap level and contains all layers for that mipmap.
settings (nil)tableOptional table of settings to configure the volume image, containing the following fields:
settings.mipmaps (false)booleanTrue to make the image use mipmaps, false to disable them. Mipmaps will be automatically generated if the image isn't a compressed texture format.
settings.linear (false)booleanTrue to treat the image's pixels as linear instead of sRGB, when gamma correct rendering is enabled. Most images are authored as sRGB.

love.graphics.origin

Resets the current coordinate transformation.

This function is always used to reverse any previous calls to love.graphics.rotate, love.graphics.scale, love.graphics.shear or love.graphics.translate. It returns the current transformation state to its defaults.

love.graphics.origin()

love.graphics.points

Draws one or more points.

love.graphics.points( x, y, ... )

xnumberThe position of the first point on the x-axis.
ynumberThe position of the first point on the y-axis.
...numberThe x and y coordinates of additional points.

love.graphics.points( points )

pointstableA table containing multiple point positions, in the form of {x, y, ...}.
points.xnumberThe position of the first point on the x-axis.
points.ynumberThe position of the first point on the y-axis.
points....numberThe x and y coordinates of additional points.

love.graphics.points( points )

pointstableA table containing multiple individually colored points, in the form of {point, ...}.
points.pointtableA table containing the position and color of the first point, in the form of {x, y, r, g, b, a}. The color components are optional.
points....tableAdditional tables containing the position and color of more points, in the form of {x, y, r, g, b, a}. The color components are optional.

love.graphics.polygon

Draw a polygon.

Following the mode argument, this function can accept multiple numeric arguments or a single table of numeric arguments. In either case the arguments are interpreted as alternating x and y coordinates of the polygon's vertices.

love.graphics.polygon( mode, ... )

modeDrawModeHow to draw the polygon.
...numberThe vertices of the polygon.

love.graphics.polygon( mode, vertices )

modeDrawModeHow to draw the polygon.
verticestableThe vertices of the polygon as a table.

love.graphics.pop

Pops the current coordinate transformation from the transformation stack.

This function is always used to reverse a previous push operation. It returns the current transformation state to what it was before the last preceding push.

love.graphics.pop()

love.graphics.present

Displays the results of drawing operations on the screen.

This function is used when writing your own love.run function. It presents all the results of your drawing operations on the screen. See the example in love.run for a typical use of this function.

love.graphics.present()

love.graphics.print

Draws text on screen. If no Font is set, one will be created and set (once) if needed.

As of LOVE 0.7.1, when using translation and scaling functions while drawing text, this function assumes the scale occurs first. If you don't script with this in mind, the text won't be in the right position, or possibly even on screen.

love.graphics.print and love.graphics.printf both support UTF-8 encoding. You'll also need a proper Font for special characters.

In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.

love.graphics.print( text, x, y, r, sx, sy, ox, oy, kx, ky )

textstringThe text to draw.
x (0)numberThe position to draw the object (x-axis).
y (0)numberThe position to draw the object (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

love.graphics.print( coloredtext, x, y, angle, sx, sy, ox, oy, kx, ky )

coloredtexttableA table containing colors and strings to add to the object, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1stringA string of text which has a color specified by the previous color.
coloredtext.color2tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2stringA string of text which has a color specified by the previous color.
coloredtext....tables and stringsAdditional colors and strings.
x (0)numberThe position of the text on the x-axis.
y (0)numberThe position of the text on the y-axis.
angle (0)numberThe orientation of the text in radians.
sx (1)numberScale factor on the x-axis.
sy (sx)numberScale factor on the y-axis.
ox (0)numberOrigin offset on the x-axis.
oy (0)numberOrigin offset on the y-axis.
kx (0)numberShearing / skew factor on the x-axis.
ky (0)numberShearing / skew factor on the y-axis.

love.graphics.print( text, transform )

textstringThe text to draw.
transformTransformTransformation object.

love.graphics.print( coloredtext, transform )

coloredtexttableA table containing colors and strings to add to the object, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1stringA string of text which has a color specified by the previous color.
coloredtext.color2tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2stringA string of text which has a color specified by the previous color.
coloredtext....tables and stringsAdditional colors and strings.
transformTransformTransformation object.

love.graphics.printf

Draws formatted text, with word wrap and alignment.

See additional notes in love.graphics.print.

The word wrap limit is applied before any scaling, rotation, and other coordinate transformations. Therefore the amount of text per line stays constant given the same wrap limit, even if the scale arguments change.

In version 0.9.2 and earlier, wrapping was implemented by breaking up words by spaces and putting them back together to make sure things fit nicely within the limit provided. However, due to the way this is done, extra spaces between words would end up missing when printed on the screen, and some lines could overflow past the provided wrap limit. In version 0.10.0 and newer this is no longer the case.

In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.

love.graphics.printf( text, x, y, limit, align, r, sx, sy, ox, oy, kx, ky )

textstringA text string.
xnumberThe position on the x-axis.
ynumberThe position on the y-axis.
limitnumberWrap the line after this many horizontal pixels.
align ('left')AlignModeThe alignment.
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

love.graphics.printf( text, font, x, y, limit, align, r, sx, sy, ox, oy, kx, ky )

textstringA text string.
fontFontThe Font object to use.
xnumberThe position on the x-axis.
ynumberThe position on the y-axis.
limitnumberWrap the line after this many horizontal pixels.
align ('left')AlignModeThe alignment.
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

love.graphics.printf( text, transform, limit, align )

textstringA text string.
transformTransformTransformation object.
limitnumberWrap the line after this many horizontal pixels.
align ('left')AlignModeThe alignment.

love.graphics.printf( text, font, transform, limit, align )

textstringA text string.
fontFontThe Font object to use.
transformTransformTransformation object.
limitnumberWrap the line after this many horizontal pixels.
align ('left')AlignModeThe alignment.

love.graphics.printf( coloredtext, x, y, limit, align, angle, sx, sy, ox, oy, kx, ky )

coloredtexttableA table containing colors and strings to add to the object, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1stringA string of text which has a color specified by the previous color.
coloredtext.color2tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2stringA string of text which has a color specified by the previous color.
coloredtext....tables and stringsAdditional colors and strings.
xnumberThe position of the text (x-axis).
ynumberThe position of the text (y-axis).
limitnumberThe maximum width in pixels of the text before it gets automatically wrapped to a new line.
alignAlignModeThe alignment of the text.
angle (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing / skew factor (x-axis).
ky (0)numberShearing / skew factor (y-axis).

love.graphics.printf( coloredtext, font, x, y, limit, align, angle, sx, sy, ox, oy, kx, ky )

coloredtexttableA table containing colors and strings to add to the object, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1stringA string of text which has a color specified by the previous color.
coloredtext.color2tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2stringA string of text which has a color specified by the previous color.
coloredtext....tables and stringsAdditional colors and strings.
fontFontThe Font object to use.
xnumberThe position on the x-axis.
ynumberThe position on the y-axis.
limitnumberWrap the line after this many horizontal pixels.
align ('left')AlignModeThe alignment.
angle (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

love.graphics.printf( coloredtext, transform, limit, align )

coloredtexttableA table containing colors and strings to add to the object, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1stringA string of text which has a color specified by the previous color.
coloredtext.color2tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2stringA string of text which has a color specified by the previous color.
coloredtext....tables and stringsAdditional colors and strings.
transformTransformTransformation object.
limitnumberWrap the line after this many horizontal pixels.
align ('left')AlignModeThe alignment.

love.graphics.printf( coloredtext, font, transform, limit, align )

coloredtexttableA table containing colors and strings to add to the object, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1stringA string of text which has a color specified by the previous color.
coloredtext.color2tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2stringA string of text which has a color specified by the previous color.
coloredtext....tables and stringsAdditional colors and strings.
fontFontThe Font object to use.
transformTransformTransformation object.
limitnumberWrap the line after this many horizontal pixels.
align ('left')AlignModeThe alignment.

love.graphics.push

Copies and pushes the current coordinate transformation to the transformation stack.

This function is always used to prepare for a corresponding pop operation later. It stores the current coordinate transformation state into the transformation stack and keeps it active. Later changes to the transformation can be undone by using the pop operation, which returns the coordinate transform to the state it was in before calling push.

love.graphics.push()

love.graphics.push( stack )

stackStackTypeThe type of stack to push (e.g. just transformation state, or all love.graphics state).

love.graphics.rectangle

Draws a rectangle.

love.graphics.rectangle( mode, x, y, width, height )

modeDrawModeHow to draw the rectangle.
xnumberThe position of top-left corner along the x-axis.
ynumberThe position of top-left corner along the y-axis.
widthnumberWidth of the rectangle.
heightnumberHeight of the rectangle.

love.graphics.rectangle( mode, x, y, width, height, rx, ry, segments )

modeDrawModeHow to draw the rectangle.
xnumberThe position of top-left corner along the x-axis.
ynumberThe position of top-left corner along the y-axis.
widthnumberWidth of the rectangle.
heightnumberHeight of the rectangle.
rxnumberThe x-axis radius of each round corner. Cannot be greater than half the rectangle's width.
ry (rx)numberThe y-axis radius of each round corner. Cannot be greater than half the rectangle's height.
segments (nil)numberThe number of segments used for drawing the round corners. A default amount will be chosen if no number is given.

love.graphics.replaceTransform

Replaces the current coordinate transformation with the given Transform object.

love.graphics.replaceTransform( transform )

transformTransformThe Transform object to replace the current graphics coordinate transform with.

love.graphics.reset

Resets the current graphics settings.

Calling reset makes the current drawing color white, the current background color black, disables any active color component masks, disables wireframe mode and resets the current graphics transformation to the origin. It also sets both the point and line drawing modes to smooth and their sizes to 1.0.

love.graphics.reset()

love.graphics.rotate

Rotates the coordinate system in two dimensions.

Calling this function affects all future drawing operations by rotating the coordinate system around the origin by the given amount of radians. This change lasts until love.draw() exits.

love.graphics.rotate( angle )

anglenumberThe amount to rotate the coordinate system in radians.

love.graphics.scale

Scales the coordinate system in two dimensions.

By default the coordinate system in LÖVE corresponds to the display pixels in horizontal and vertical directions one-to-one, and the x-axis increases towards the right while the y-axis increases downwards. Scaling the coordinate system changes this relation.

After scaling by sx and sy, all coordinates are treated as if they were multiplied by sx and sy. Every result of a drawing operation is also correspondingly scaled, so scaling by (2, 2) for example would mean making everything twice as large in both x- and y-directions. Scaling by a negative value flips the coordinate system in the corresponding direction, which also means everything will be drawn flipped or upside down, or both. Scaling by zero is not a useful operation.

Scale and translate are not commutative operations, therefore, calling them in different orders will change the outcome.

Scaling lasts until love.draw() exits.

love.graphics.scale( sx, sy )

sxnumberThe scaling in the direction of the x-axis.
sy (sx)numberThe scaling in the direction of the y-axis. If omitted, it defaults to same as parameter sx.

love.graphics.setBackgroundColor

Sets the background color.

love.graphics.setBackgroundColor( red, green, blue, alpha )

rednumberThe red component (0-1).
greennumberThe green component (0-1).
bluenumberThe blue component (0-1).
alpha (1)numberThe alpha component (0-1).

love.graphics.setBackgroundColor()

love.graphics.setBackgroundColor()

love.graphics.setBlendMode

Sets the blending mode.

love.graphics.setBlendMode( mode )

modeBlendModeThe blend mode to use.

love.graphics.setBlendMode( mode, alphamode )

modeBlendModeThe blend mode to use.
alphamode ('alphamultiply')BlendAlphaModeWhat to do with the alpha of drawn objects when blending.

love.graphics.setCanvas

Captures drawing operations to a Canvas.

love.graphics.setCanvas( canvas, mipmap )

canvasCanvasThe new target.
mipmap (1)numberThe mipmap level to render to, for Canvases with mipmaps.

love.graphics.setCanvas()

love.graphics.setCanvas( canvas1, canvas2, ... )

canvas1CanvasThe first render target.
canvas2CanvasThe second render target.
...CanvasMore canvases.

love.graphics.setCanvas( canvas, slice, mipmap )

canvasCanvasThe new render target.
slicenumberFor cubemaps this is the cube face index to render to (between 1 and 6). For Array textures this is the array layer. For volume textures this is the depth slice. 2D canvases should use a value of 1.
mipmap (1)numberThe mipmap level to render to, for Canvases with mipmaps.

love.graphics.setCanvas( setup )

setuptableA table specifying the active Canvas(es), their mipmap levels and active layers if applicable, and whether to use a stencil and/or depth buffer.
setup.1RenderTargetSetupThe Canvas to render to.
setup.2 (nil)RenderTargetSetupAn additional Canvas to render to, if multiple simultaneous render targets are wanted.
setup....RenderTargetSetupAdditional Canvases to render to, if multiple simultaneous render targets are wanted.
setup.stencil (false)booleanWhether an internally managed stencil buffer should be used, if the depthstencil field isn't set.
setup.depth (false)booleanWhether an internally managed depth buffer should be used, if the depthstencil field isn't set.
setup.depthstencil (nil)RenderTargetSetupAn optional custom depth/stencil formatted Canvas to use for the depth and/or stencil buffer.

love.graphics.setColor

Sets the color used for drawing.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

love.graphics.setColor( red, green, blue, alpha )

rednumberThe amount of red.
greennumberThe amount of green.
bluenumberThe amount of blue.
alpha (1)numberThe amount of alpha. The alpha value will be applied to all subsequent draw operations, even the drawing of an image.

love.graphics.setColor( rgba )

rgbatableA numerical indexed table with the red, green, blue and alpha values as numbers. The alpha is optional and defaults to 1 if it is left out.

love.graphics.setColorMask

Sets the color mask. Enables or disables specific color components when rendering and clearing the screen. For example, if '''red''' is set to '''false''', no further changes will be made to the red component of any pixels.

love.graphics.setColorMask( red, green, blue, alpha )

redbooleanRender red component.
greenbooleanRender green component.
bluebooleanRender blue component.
alphabooleanRender alpha component.

love.graphics.setColorMask()

love.graphics.setDefaultFilter

Sets the default scaling filters used with Images, Canvases, and Fonts.

love.graphics.setDefaultFilter( min, mag, anisotropy )

minFilterModeFilter mode used when scaling the image down.
magFilterModeFilter mode used when scaling the image up.
anisotropy (1)numberMaximum amount of Anisotropic Filtering used.

love.graphics.setDepthMode

Configures depth testing and writing to the depth buffer.

This is low-level functionality designed for use with custom vertex shaders and Meshes with custom vertex attributes. No higher level APIs are provided to set the depth of 2D graphics such as shapes, lines, and Images.

love.graphics.setDepthMode( comparemode, write )

comparemodeCompareModeDepth comparison mode used for depth testing.
writebooleanWhether to write update / write values to the depth buffer when rendering.

love.graphics.setDepthMode()

love.graphics.setFont

Set an already-loaded Font as the current font or create and load a new one from the file and size.

It's recommended that Font objects are created with love.graphics.newFont in the loading stage and then passed to this function in the drawing stage.

love.graphics.setFont( font )

fontFontThe Font object to use.

love.graphics.setFrontFaceWinding

Sets whether triangles with clockwise- or counterclockwise-ordered vertices are considered front-facing.

This is designed for use in combination with Mesh face culling. Other love.graphics shapes, lines, and sprites are not guaranteed to have a specific winding order to their internal vertices.

love.graphics.setFrontFaceWinding( winding )

windingVertexWindingThe winding mode to use. The default winding is counterclockwise ('ccw').

love.graphics.setLineJoin

Sets the line join style. See LineJoin for the possible options.

love.graphics.setLineJoin( join )

joinLineJoinThe LineJoin to use.

love.graphics.setLineStyle

Sets the line style.

love.graphics.setLineStyle( style )

styleLineStyleThe LineStyle to use. Line styles include smooth and rough.

love.graphics.setLineWidth

Sets the line width.

love.graphics.setLineWidth( width )

widthnumberThe width of the line.

love.graphics.setMeshCullMode

Sets whether back-facing triangles in a Mesh are culled.

This is designed for use with low level custom hardware-accelerated 3D rendering via custom vertex attributes on Meshes, custom vertex shaders, and depth testing with a depth buffer.

By default, both front- and back-facing triangles in Meshes are rendered.

love.graphics.setMeshCullMode( mode )

modeCullModeThe Mesh face culling mode to use (whether to render everything, cull back-facing triangles, or cull front-facing triangles).

love.graphics.setNewFont

Creates and sets a new Font.

font = love.graphics.setNewFont( size )

fontFontThe new font.
size (12)numberThe size of the font.

font = love.graphics.setNewFont( filename, size )

fontFontThe new font.
filenamestringThe path and name of the file with the font.
size (12)numberThe size of the font.

font = love.graphics.setNewFont( file, size )

fontFontThe new font.
fileFileA File with the font.
size (12)numberThe size of the font.

font = love.graphics.setNewFont( data, size )

fontFontThe new font.
dataDataA Data with the font.
size (12)numberThe size of the font.

font = love.graphics.setNewFont( rasterizer )

fontFontThe new font.
rasterizerRasterizerA rasterizer.

love.graphics.setPointSize

Sets the point size.

love.graphics.setPointSize( size )

sizenumberThe new point size.

love.graphics.setScissor

Sets or disables scissor.

The scissor limits the drawing area to a specified rectangle. This affects all graphics calls, including love.graphics.clear.

The dimensions of the scissor is unaffected by graphical transformations (translate, scale, ...).

love.graphics.setScissor( x, y, width, height )

xnumberx coordinate of upper left corner.
ynumbery coordinate of upper left corner.
widthnumberwidth of clipping rectangle.
heightnumberheight of clipping rectangle.

love.graphics.setScissor()

love.graphics.setShader

Sets or resets a Shader as the current pixel effect or vertex shaders. All drawing operations until the next ''love.graphics.setShader'' will be drawn using the Shader object specified.

love.graphics.setShader( shader )

shaderShaderThe new shader.

love.graphics.setShader()

love.graphics.setStencilTest

Configures or disables stencil testing.

When stencil testing is enabled, the geometry of everything that is drawn afterward will be clipped / stencilled out based on a comparison between the arguments of this function and the stencil value of each pixel that the geometry touches. The stencil values of pixels are affected via love.graphics.stencil.

love.graphics.setStencilTest( comparemode, comparevalue )

comparemodeCompareModeThe type of comparison to make for each pixel.
comparevaluenumberThe value to use when comparing with the stencil value of each pixel. Must be between 0 and 255.

love.graphics.setStencilTest()

love.graphics.setWireframe

Sets whether wireframe lines will be used when drawing.

love.graphics.setWireframe( enable )

enablebooleanTrue to enable wireframe mode when drawing, false to disable it.

love.graphics.shear

Shears the coordinate system.

love.graphics.shear( kx, ky )

kxnumberThe shear factor on the x-axis.
kynumberThe shear factor on the y-axis.

love.graphics.stencil

Draws geometry as a stencil.

The geometry drawn by the supplied function sets invisible stencil values of pixels, instead of setting pixel colors. The stencil buffer (which contains those stencil values) can act like a mask / stencil - love.graphics.setStencilTest can be used afterward to determine how further rendering is affected by the stencil values in each pixel.

Stencil values are integers within the range of 255.

love.graphics.stencil( stencilfunction, action, value, keepvalues )

stencilfunctionfunctionFunction which draws geometry. The stencil values of pixels, rather than the color of each pixel, will be affected by the geometry.
action ('replace')StencilActionHow to modify any stencil values of pixels that are touched by what's drawn in the stencil function.
value (1)numberThe new stencil value to use for pixels if the 'replace' stencil action is used. Has no effect with other stencil actions. Must be between 0 and 255.
keepvalues (false)booleanTrue to preserve old stencil values of pixels, false to re-set every pixel's stencil value to 0 before executing the stencil function. love.graphics.clear will also re-set all stencil values.

love.graphics.transformPoint

Converts the given 2D position from global coordinates into screen-space.

This effectively applies the current graphics transformations to the given position. A similar Transform:transformPoint method exists for Transform objects.

screenX, screenY = love.graphics.transformPoint( globalX, globalY )

screenXnumberThe x component of the position with graphics transformations applied.
screenYnumberThe y component of the position with graphics transformations applied.
globalXnumberThe x component of the position in global coordinates.
globalYnumberThe y component of the position in global coordinates.

love.graphics.translate

Translates the coordinate system in two dimensions.

When this function is called with two numbers, dx, and dy, all the following drawing operations take effect as if their x and y coordinates were x+dx and y+dy.

Scale and translate are not commutative operations, therefore, calling them in different orders will change the outcome.

This change lasts until love.draw() exits or else a love.graphics.pop reverts to a previous love.graphics.push.

Translating using whole numbers will prevent tearing/blurring of images and fonts draw after translating.

love.graphics.translate( dx, dy )

dxnumberThe translation relative to the x-axis.
dynumberThe translation relative to the y-axis.

love.graphics.validateShader

Validates shader code. Check if specified shader code does not contain any errors.

status, message = love.graphics.validateShader( gles, code )

statusbooleantrue if specified shader code doesn't contain any errors. false otherwise.
messagestringReason why shader code validation failed (or nil if validation succeded).
glesbooleanValidate code as GLSL ES shader.
codestringThe pixel shader or vertex shader code, or a filename pointing to a file with the code.

status, message = love.graphics.validateShader( gles, pixelcode, vertexcode )

statusbooleantrue if specified shader code doesn't contain any errors. false otherwise.
messagestringReason why shader code validation failed (or nil if validation succeded).
glesbooleanValidate code as GLSL ES shader.
pixelcodestringThe pixel shader code, or a filename pointing to a file with the code.
vertexcodestringThe vertex shader code, or a filename pointing to a file with the code.

Canvas:generateMipmaps

Generates mipmaps for the Canvas, based on the contents of the highest-resolution mipmap level.

The Canvas must be created with mipmaps set to a MipmapMode other than 'none' for this function to work. It should only be called while the Canvas is not the active render target.

If the mipmap mode is set to 'auto', this function is automatically called inside love.graphics.setCanvas when switching from this Canvas to another Canvas or to the main screen.

Canvas:generateMipmaps()

Canvas:getDimensions

Gets the width and height of the Canvas.

width, height = Canvas:getDimensions()

widthnumberThe width of the Canvas, in pixels.
heightnumberThe height of the Canvas, in pixels.

Canvas:getFilter

Gets the filter mode of the Canvas.

min, mag = Canvas:getFilter()

minFilterModeFilter mode used when minifying the canvas.
magFilterModeFilter mode used when magnifying the canvas.

min, mag, anisotropy = Canvas:getFilter()

minFilterModeFilter mode used when minifying the canvas.
magFilterModeFilter mode used when magnifying the canvas.
anisotropynumberMaximum amount of anisotropic filtering used.

Canvas:getHeight

Gets the height of the Canvas.

height = Canvas:getHeight()

heightnumberThe height of the Canvas, in pixels.

Canvas:getMSAA

Gets the number of multisample antialiasing (MSAA) samples used when drawing to the Canvas.

This may be different than the number used as an argument to love.graphics.newCanvas if the system running LÖVE doesn't support that number.

samples = Canvas:getMSAA()

samplesnumberThe number of multisample antialiasing samples used by the canvas when drawing to it.

Canvas:getMipmapMode

Gets the MipmapMode this Canvas was created with.

mode = Canvas:getMipmapMode()

modeMipmapModeThe mipmap mode this Canvas was created with.

Canvas:getWidth

Gets the width of the Canvas.

width = Canvas:getWidth()

widthnumberThe width of the Canvas, in pixels.

Canvas:getWrap

Gets the wrapping properties of a Canvas.

This function returns the currently set horizontal and vertical wrapping modes for the Canvas.

horiz, vert = Canvas:getWrap()

horizWrapModeHorizontal wrapping mode of the Canvas.
vertWrapModeVertical wrapping mode of the Canvas.

Canvas:newImageData

Generates ImageData from the contents of the Canvas.

data = Canvas:newImageData()

dataImageDataThe new ImageData made from the Canvas' contents.

data = Canvas:newImageData( slice, mipmap, x, y, width, height )

dataImageDataThe new ImageData made from the Canvas' contents.
slicenumberThe cubemap face index, array index, or depth layer for cubemap, array, or volume type Canvases, respectively. This argument is ignored for regular 2D canvases.
mipmap (1)numberThe mipmap index to use, for Canvases with mipmaps.
xnumberThe x-axis of the top-left corner (in pixels) of the area within the Canvas to capture.
ynumberThe y-axis of the top-left corner (in pixels) of the area within the Canvas to capture.
widthnumberThe width in pixels of the area within the Canvas to capture.
heightnumberThe height in pixels of the area within the Canvas to capture.

Canvas:renderTo

Render to the Canvas using a function.

This is a shortcut to love.graphics.setCanvas:

canvas:renderTo( func )

is the same as

love.graphics.setCanvas( canvas )

func()

love.graphics.setCanvas()

Canvas:renderTo( func )

funcfunctionA function performing drawing operations.

Canvas:setFilter

Sets the filter mode of the Canvas.

Canvas:setFilter( min, mag )

minFilterModeFilter mode to use when minifying the canvas.
magFilterModeFilter mode to use when magnifying the canvas.

Canvas:setFilter( min, mag, anisotropy )

minFilterModeFilter mode to use when minifying the canvas.
magFilterModeFilter mode to use when magnifying the canvas.
anisotropy (1)numberMaximum amount of anisotropic filtering to use.

Canvas:setWrap

Sets the wrapping properties of a Canvas.

This function sets the way the edges of a Canvas are treated if it is scaled or rotated. If the WrapMode is set to 'clamp', the edge will not be interpolated. If set to 'repeat', the edge will be interpolated with the pixels on the opposing side of the framebuffer.

Canvas:setWrap( horiz, vert )

horizWrapModeHorizontal wrapping mode of the Canvas.
vertWrapModeVertical wrapping mode of the Canvas.

Font:getAscent

Gets the ascent of the Font.

The ascent spans the distance between the baseline and the top of the glyph that reaches farthest from the baseline.

ascent = Font:getAscent()

ascentnumberThe ascent of the Font in pixels.

Font:getBaseline

Gets the baseline of the Font.

Most scripts share the notion of a baseline: an imaginary horizontal line on which characters rest. In some scripts, parts of glyphs lie below the baseline.

baseline = Font:getBaseline()

baselinenumberThe baseline of the Font in pixels.

Font:getDPIScale

Gets the DPI scale factor of the Font.

The DPI scale factor represents relative pixel density. A DPI scale factor of 2 means the font's glyphs have twice the pixel density in each dimension (4 times as many pixels in the same area) compared to a font with a DPI scale factor of 1.

The font size of TrueType fonts is scaled internally by the font's specified DPI scale factor. By default, LÖVE uses the screen's DPI scale factor when creating TrueType fonts.

dpiscale = Font:getDPIScale()

dpiscalenumberThe DPI scale factor of the Font.

Font:getDescent

Gets the descent of the Font.

The descent spans the distance between the baseline and the lowest descending glyph in a typeface.

descent = Font:getDescent()

descentnumberThe descent of the Font in pixels.

Font:getFilter

Gets the filter mode for a font.

min, mag, anisotropy = Font:getFilter()

minFilterModeFilter mode used when minifying the font.
magFilterModeFilter mode used when magnifying the font.
anisotropynumberMaximum amount of anisotropic filtering used.

Font:getHeight

Gets the height of the Font.

The height of the font is the size including any spacing; the height which it will need.

height = Font:getHeight()

heightnumberThe height of the Font in pixels.

Font:getLineHeight

Gets the line height.

This will be the value previously set by Font:setLineHeight, or 1.0 by default.

height = Font:getLineHeight()

heightnumberThe current line height.

Font:getWidth

Determines the maximum width (accounting for newlines) taken by the given string.

width = Font:getWidth( text )

widthnumberThe width of the text.
textstringA string.

Font:getWrap

Gets formatting information for text, given a wrap limit.

This function accounts for newlines correctly (i.e. '\n').

width, wrappedtext = Font:getWrap( text, wraplimit )

widthnumberThe maximum width of the wrapped text.
wrappedtexttableA sequence containing each line of text that was wrapped.
textstringThe text that will be wrapped.
wraplimitnumberThe maximum width in pixels of each line that ''text'' is allowed before wrapping.

Font:hasGlyphs

Gets whether the Font can render a character or string.

hasglyph = Font:hasGlyphs( text )

hasglyphbooleanWhether the font can render all the UTF-8 characters in the string.
textstringA UTF-8 encoded unicode string.

hasglyph = Font:hasGlyphs( character1, character2 )

hasglyphbooleanWhether the font can render all the glyphs represented by the characters.
character1stringA unicode character.
character2stringAnother unicode character.

hasglyph = Font:hasGlyphs( codepoint1, codepoint2 )

hasglyphbooleanWhether the font can render all the glyphs represented by the codepoint numbers.
codepoint1numberA unicode codepoint number.
codepoint2numberAnother unicode codepoint number.

Font:setFallbacks

Sets the fallback fonts. When the Font doesn't contain a glyph, it will substitute the glyph from the next subsequent fallback Fonts. This is akin to setting a 'font stack' in Cascading Style Sheets (CSS).

Font:setFallbacks( fallbackfont1, ... )

fallbackfont1FontThe first fallback Font to use.
...FontAdditional fallback Fonts.

Font:setFilter

Sets the filter mode for a font.

Font:setFilter( min, mag, anisotropy )

minFilterModeHow to scale a font down.
magFilterModeHow to scale a font up.
anisotropy (1)numberMaximum amount of anisotropic filtering used.

Font:setLineHeight

Sets the line height.

When rendering the font in lines the actual height will be

determined by the line height multiplied by the height of the font.

The default is 1.0.

Font:setLineHeight( height )

heightnumberThe new line height.

Image:getDimensions

Gets the width and height of the Image.

width, height = Image:getDimensions()

widthnumberThe width of the Image, in pixels.
heightnumberThe height of the Image, in pixels.

Image:getFilter

Gets the filter mode for an image.

min, mag = Image:getFilter()

minFilterModeFilter mode used when minifying the image.
magFilterModeFilter mode used when magnifying the image.

min, mag, anisotropy = Image:getFilter()

minFilterModeFilter mode used when minifying the image.
magFilterModeFilter mode used when magnifying the image.
anisotropynumberMaximum amount of anisotropic filtering used.

Image:getFlags

Gets the flags used when the image was created.

flags = Image:getFlags()

flagstableA table with ImageFlag keys.

Image:getHeight

Gets the height of the Image.

height = Image:getHeight()

heightnumberThe height of the Image, in pixels.

Image:getWidth

Gets the width of the Image.

width = Image:getWidth()

widthnumberThe width of the Image, in pixels.

Image:getWrap

Gets the wrapping properties of an Image.

This function returns the currently set horizontal and vertical wrapping modes for the image.

horiz, vert = Image:getWrap()

horizWrapModeHorizontal wrapping mode of the image.
vertWrapModeVertical wrapping mode of the image.

Image:replacePixels

Replace the contents of an Image.

Image:replacePixels( data, slice, mipmap, x, y, reloadmipmaps )

dataImageDataThe new ImageData to replace the contents with.
slicenumberWhich cubemap face, array index, or volume layer to replace, if applicable.
mipmap (1)numberThe mimap level to replace, if the Image has mipmaps.
x (0)numberThe x-offset in pixels from the top-left of the image to replace. The given ImageData's width plus this value must not be greater than the pixel width of the Image's specified mipmap level.
y (0)numberThe y-offset in pixels from the top-left of the image to replace. The given ImageData's height plus this value must not be greater than the pixel height of the Image's specified mipmap level.
reloadmipmapsbooleanWhether to generate new mipmaps after replacing the Image's pixels. True by default if the Image was created with automatically generated mipmaps, false by default otherwise.

Image:setFilter

Sets the filter mode for an image.

Image:setFilter( min, mag )

minFilterModeHow to scale an image down.
magFilterModeHow to scale an image up.

Image:setFilter( min, mag, anisotropy )

minFilterModeHow to scale an image down.
magFilterModeHow to scale an image up.
anisotropy (1)numberMaximum amount of anisotropic filtering used.

Image:setWrap

Sets the wrapping properties of an Image.

This function sets the way an Image is repeated when it is drawn with a Quad that is larger than the image's extent. An image may be clamped or set to repeat in both horizontal and vertical directions. Clamped images appear only once, but repeated ones repeat as many times as there is room in the Quad.

N.B. If you use a Quad that is larger than the image extent and do not use repeated tiling, there may be an unwanted visual effect of the image stretching all the way to fill the Quad. If this is the case, setting Image:setWrap('repeat', 'repeat') for all the images to be repeated, and using Quads of appropriate size will result in the best visual appearance.

Image:setWrap( horiz, vert )

horizWrapModeHorizontal wrapping mode of the image.
vertWrapModeVertical wrapping mode of the image.

Mesh:attachAttribute

Attaches a vertex attribute from a different Mesh onto this Mesh, for use when drawing. This can be used to share vertex attribute data between several different Meshes.

Mesh:attachAttribute( name, mesh )

namestringThe name of the vertex attribute to attach.
meshMeshThe Mesh to get the vertex attribute from.

Mesh:attachAttribute( name, mesh, step, attachname )

namestringThe name of the vertex attribute to attach.
meshMeshThe Mesh to get the vertex attribute from.
step ('pervertex')VertexAttributeStepWhether the attribute will be per-vertex or per-instance when the mesh is drawn.
attachname (name)stringThe name of the attribute to use in shader code. Defaults to the name of the attribute in the given mesh. Can be used to use a different name for this attribute when rendering.

Mesh:attachAttribute

Attaches a vertex attribute from a different Mesh onto this Mesh, for use when drawing. This can be used to share vertex attribute data between several different Meshes.

Mesh:attachAttribute( name, mesh )

namestringThe name of the vertex attribute to attach.
meshMeshThe Mesh to get the vertex attribute from.

Mesh:attachAttribute( name, mesh, step, attachname )

namestringThe name of the vertex attribute to attach.
meshMeshThe Mesh to get the vertex attribute from.
step ('pervertex')VertexAttributeStepWhether the attribute will be per-vertex or per-instance when the mesh is drawn.
attachname (name)stringThe name of the attribute to use in shader code. Defaults to the name of the attribute in the given mesh. Can be used to use a different name for this attribute when rendering.

Mesh:detachAttribute

Removes a previously attached vertex attribute from this Mesh.

success = Mesh:detachAttribute( name )

successbooleanWhether the attribute was successfully detached.
namestringThe name of the attached vertex attribute to detach.

Mesh:getDrawMode

Gets the mode used when drawing the Mesh.

mode = Mesh:getDrawMode()

modeMeshDrawModeThe mode used when drawing the Mesh.

Mesh:getDrawRange

Gets the range of vertices used when drawing the Mesh.

min, max = Mesh:getDrawRange()

minnumberThe index of the first vertex used when drawing, or the index of the first value in the vertex map used if one is set for this Mesh.
maxnumberThe index of the last vertex used when drawing, or the index of the last value in the vertex map used if one is set for this Mesh.

Mesh:getTexture

Gets the texture (Image or Canvas) used when drawing the Mesh.

texture = Mesh:getTexture()

textureTextureThe Image or Canvas to texture the Mesh with when drawing, or nil if none is set.

Mesh:getVertex

Gets the properties of a vertex in the Mesh.

In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.

attributecomponent, ... = Mesh:getVertex( index )

attributecomponentnumberThe first component of the first vertex attribute in the specified vertex.
...numberAdditional components of all vertex attributes in the specified vertex.
indexnumberThe one-based index of the vertex you want to retrieve the information for.

x, y, u, v, r, g, b, a = Mesh:getVertex( index )

xnumberThe position of the vertex on the x-axis.
ynumberThe position of the vertex on the y-axis.
unumberThe horizontal component of the texture coordinate.
vnumberThe vertical component of the texture coordinate.
rnumberThe red component of the vertex's color.
gnumberThe green component of the vertex's color.
bnumberThe blue component of the vertex's color.
anumberThe alpha component of the vertex's color.
indexnumberThe index of the vertex you want to retrieve the information for.

Mesh:getVertexAttribute

Gets the properties of a specific attribute within a vertex in the Mesh.

Meshes without a custom vertex format specified in love.graphics.newMesh have position as their first attribute, texture coordinates as their second attribute, and color as their third attribute.

value1, value2, ... = Mesh:getVertexAttribute( vertexindex, attributeindex )

value1numberThe value of the first component of the attribute.
value2numberThe value of the second component of the attribute.
...numberAny additional vertex attribute components.
vertexindexnumberThe index of the the vertex you want to retrieve the attribute for (one-based).
attributeindexnumberThe index of the attribute within the vertex to be retrieved (one-based).

Mesh:getVertexCount

Gets the total number of vertices in the Mesh.

count = Mesh:getVertexCount()

countnumberThe total number of vertices in the mesh.

Mesh:getVertexFormat

Gets the vertex format that the Mesh was created with.

format = Mesh:getVertexFormat()

formattableThe vertex format of the Mesh, which is a table containing tables for each vertex attribute the Mesh was created with, in the form of {attribute, ...}.
format.attributetableA table containing the attribute's name, it's data type, and the number of components in the attribute, in the form of {name, datatype, components}.
format....tableAdditional vertex attributes in the Mesh.

Mesh:getVertexMap

Gets the vertex map for the Mesh. The vertex map describes the order in which the vertices are used when the Mesh is drawn. The vertices, vertex map, and mesh draw mode work together to determine what exactly is displayed on the screen.

If no vertex map has been set previously via Mesh:setVertexMap, then this function will return nil in LÖVE 0.10.0+, or an empty table in 0.9.2 and older.

map = Mesh:getVertexMap()

maptableA table containing the list of vertex indices used when drawing.

Mesh:isAttributeEnabled

Gets whether a specific vertex attribute in the Mesh is enabled. Vertex data from disabled attributes is not used when drawing the Mesh.

enabled = Mesh:isAttributeEnabled( name )

enabledbooleanWhether the vertex attribute is used when drawing this Mesh.
namestringThe name of the vertex attribute to be checked.

Mesh:setAttributeEnabled

Enables or disables a specific vertex attribute in the Mesh. Vertex data from disabled attributes is not used when drawing the Mesh.

Mesh:setAttributeEnabled( name, enable )

namestringThe name of the vertex attribute to enable or disable.
enablebooleanWhether the vertex attribute is used when drawing this Mesh.

Mesh:setDrawMode

Sets the mode used when drawing the Mesh.

Mesh:setDrawMode( mode )

modeMeshDrawModeThe mode to use when drawing the Mesh.

Mesh:setDrawRange

Restricts the drawn vertices of the Mesh to a subset of the total.

Mesh:setDrawRange( start, count )

startnumberThe index of the first vertex to use when drawing, or the index of the first value in the vertex map to use if one is set for this Mesh.
countnumberThe number of vertices to use when drawing, or number of values in the vertex map to use if one is set for this Mesh.

Mesh:setDrawRange()

Mesh:setTexture

Sets the texture (Image or Canvas) used when drawing the Mesh.

Mesh:setTexture( texture )

textureTextureThe Image or Canvas to texture the Mesh with when drawing.

Mesh:setTexture()

Mesh:setVertex

Sets the properties of a vertex in the Mesh.

In versions prior to 11.0, color and byte component values were within the range of 0 to 255 instead of 0 to 1.

Mesh:setVertex( index, attributecomponent, ... )

indexnumberThe index of the the vertex you want to modify (one-based).
attributecomponentnumberThe first component of the first vertex attribute in the specified vertex.
...numberAdditional components of all vertex attributes in the specified vertex.

Mesh:setVertex( index, vertex )

indexnumberThe index of the the vertex you want to modify (one-based).
vertextableA table with vertex information, in the form of {attributecomponent, ...}.
vertex.attributecomponentnumberThe first component of the first vertex attribute in the specified vertex.
vertex....numberAdditional components of all vertex attributes in the specified vertex.

Mesh:setVertex( index, x, y, u, v, r, g, b, a )

indexnumberThe index of the the vertex you want to modify (one-based).
xnumberThe position of the vertex on the x-axis.
ynumberThe position of the vertex on the y-axis.
unumberThe horizontal component of the texture coordinate.
vnumberThe vertical component of the texture coordinate.
r (1)numberThe red component of the vertex's color.
g (1)numberThe green component of the vertex's color.
b (1)numberThe blue component of the vertex's color.
a (1)numberThe alpha component of the vertex's color.

Mesh:setVertex( index, vertex )

indexnumberThe index of the the vertex you want to modify (one-based).
vertextableA table with vertex information.
vertex.1numberThe position of the vertex on the x-axis.
vertex.2numberThe position of the vertex on the y-axis.
vertex.3numberThe u texture coordinate. Texture coordinates are normally in the range of 1, but can be greater or less (see WrapMode.)
vertex.4numberThe v texture coordinate. Texture coordinates are normally in the range of 1, but can be greater or less (see WrapMode.)
vertex.5 (1)numberThe red color component.
vertex.6 (1)numberThe green color component.
vertex.7 (1)numberThe blue color component.
vertex.8 (1)numberThe alpha color component.

Mesh:setVertexAttribute

Sets the properties of a specific attribute within a vertex in the Mesh.

Meshes without a custom vertex format specified in love.graphics.newMesh have position as their first attribute, texture coordinates as their second attribute, and color as their third attribute.

Mesh:setVertexAttribute( vertexindex, attributeindex, value1, value2, ... )

vertexindexnumberThe index of the the vertex to be modified (one-based).
attributeindexnumberThe index of the attribute within the vertex to be modified (one-based).
value1numberThe new value for the first component of the attribute.
value2numberThe new value for the second component of the attribute.
...numberAny additional vertex attribute components.

Mesh:setVertexMap

Sets the vertex map for the Mesh. The vertex map describes the order in which the vertices are used when the Mesh is drawn. The vertices, vertex map, and mesh draw mode work together to determine what exactly is displayed on the screen.

The vertex map allows you to re-order or reuse vertices when drawing without changing the actual vertex parameters or duplicating vertices. It is especially useful when combined with different Mesh Draw Modes.

Mesh:setVertexMap( map )

maptableA table containing a list of vertex indices to use when drawing. Values must be in the range of Mesh:getVertexCount().

Mesh:setVertexMap( vi1, vi2, vi3 )

vi1numberThe index of the first vertex to use when drawing. Must be in the range of Mesh:getVertexCount().
vi2numberThe index of the second vertex to use when drawing.
vi3numberThe index of the third vertex to use when drawing.

Mesh:setVertexMap( data, datatype )

dataDataArray of vertex indices to use when drawing. Values must be in the range of Mesh:getVertexCount()-1
datatypeIndexDataTypeDatatype of the vertex indices array above.

Mesh:setVertices

Replaces a range of vertices in the Mesh with new ones. The total number of vertices in a Mesh cannot be changed after it has been created. This is often more efficient than calling Mesh:setVertex in a loop.

Mesh:setVertices( vertices, startvertex )

verticestableThe table filled with vertex information tables for each vertex, in the form of {vertex, ...} where each vertex is a table in the form of {attributecomponent, ...}.
vertices.attributecomponentnumberThe first component of the first vertex attribute in the vertex.
vertices....numberAdditional components of all vertex attributes in the vertex.
startvertex (1)numberThe index of the first vertex to replace.

Mesh:setVertices( data, startvertex )

dataDataA Data object to copy from. The contents of the Data must match the layout of this Mesh's vertex format.
startvertex (1)numberThe index of the first vertex to replace.

Mesh:setVertices( vertices )

verticestableThe table filled with vertex information tables for each vertex as follows:
vertices.1numberThe position of the vertex on the x-axis.
vertices.2numberThe position of the vertex on the y-axis.
vertices.3numberThe horizontal component of the texture coordinate. Texture coordinates are normally in the range of 1, but can be greater or less (see WrapMode).
vertices.4numberThe vertical component of the texture coordinate. Texture coordinates are normally in the range of 1, but can be greater or less (see WrapMode).
vertices.5 (1)numberThe red color component.
vertices.6 (1)numberThe green color component.
vertices.7 (1)numberThe blue color component.
vertices.8 (1)numberThe alpha color component.

ParticleSystem:clone

Creates an identical copy of the ParticleSystem in the stopped state.

particlesystem = ParticleSystem:clone()

particlesystemParticleSystemThe new identical copy of this ParticleSystem.

ParticleSystem:emit

Emits a burst of particles from the particle emitter.

ParticleSystem:emit( numparticles )

numparticlesnumberThe amount of particles to emit. The number of emitted particles will be truncated if the particle system's max buffer size is reached.

ParticleSystem:getBufferSize

Gets the maximum number of particles the ParticleSystem can have at once.

size = ParticleSystem:getBufferSize()

sizenumberThe maximum number of particles.

ParticleSystem:getColors

Gets the series of colors applied to the particle sprite.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

r1, g1, b1, a1, r2, g2, b2, a2, r8, g8, b8, a8 = ParticleSystem:getColors()

r1numberFirst color, red component (0-1).
g1numberFirst color, green component (0-1).
b1numberFirst color, blue component (0-1).
a1numberFirst color, alpha component (0-1).
r2numberSecond color, red component (0-1).
g2numberSecond color, green component (0-1).
b2numberSecond color, blue component (0-1).
a2numberSecond color, alpha component (0-1).
r8numberEighth color, red component (0-1).
g8numberEighth color, green component (0-1).
b8numberEighth color, blue component (0-1).
a8numberEighth color, alpha component (0-1).

ParticleSystem:getCount

Gets the number of particles that are currently in the system.

count = ParticleSystem:getCount()

countnumberThe current number of live particles.

ParticleSystem:getDirection

Gets the direction of the particle emitter (in radians).

direction = ParticleSystem:getDirection()

directionnumberThe direction of the emitter (radians).

ParticleSystem:getEmissionArea

Gets the area-based spawn parameters for the particles.

distribution, dx, dy, angle, directionRelativeToCenter = ParticleSystem:getEmissionArea()

distributionAreaSpreadDistributionThe type of distribution for new particles.
dxnumberThe maximum spawn distance from the emitter along the x-axis for uniform distribution, or the standard deviation along the x-axis for normal distribution.
dynumberThe maximum spawn distance from the emitter along the y-axis for uniform distribution, or the standard deviation along the y-axis for normal distribution.
anglenumberThe angle in radians of the emission area.
directionRelativeToCenterbooleanTrue if newly spawned particles will be oriented relative to the center of the emission area, false otherwise.

ParticleSystem:getEmissionRate

Gets the amount of particles emitted per second.

rate = ParticleSystem:getEmissionRate()

ratenumberThe amount of particles per second.

ParticleSystem:getEmitterLifetime

Gets how long the particle system will emit particles (if -1 then it emits particles forever).

life = ParticleSystem:getEmitterLifetime()

lifenumberThe lifetime of the emitter (in seconds).

ParticleSystem:getInsertMode

Gets the mode used when the ParticleSystem adds new particles.

mode = ParticleSystem:getInsertMode()

modeParticleInsertModeThe mode used when the ParticleSystem adds new particles.

ParticleSystem:getLinearAcceleration

Gets the linear acceleration (acceleration along the x and y axes) for particles.

Every particle created will accelerate along the x and y axes between xmin,ymin and xmax,ymax.

xmin, ymin, xmax, ymax = ParticleSystem:getLinearAcceleration()

xminnumberThe minimum acceleration along the x axis.
yminnumberThe minimum acceleration along the y axis.
xmaxnumberThe maximum acceleration along the x axis.
ymaxnumberThe maximum acceleration along the y axis.

ParticleSystem:getLinearDamping

Gets the amount of linear damping (constant deceleration) for particles.

min, max = ParticleSystem:getLinearDamping()

minnumberThe minimum amount of linear damping applied to particles.
maxnumberThe maximum amount of linear damping applied to particles.

ParticleSystem:getOffset

Gets the particle image's draw offset.

ox, oy = ParticleSystem:getOffset()

oxnumberThe x coordinate of the particle image's draw offset.
oynumberThe y coordinate of the particle image's draw offset.

ParticleSystem:getParticleLifetime

Gets the lifetime of the particles.

min, max = ParticleSystem:getParticleLifetime()

minnumberThe minimum life of the particles (in seconds).
maxnumberThe maximum life of the particles (in seconds).

ParticleSystem:getPosition

Gets the position of the emitter.

x, y = ParticleSystem:getPosition()

xnumberPosition along x-axis.
ynumberPosition along y-axis.

ParticleSystem:getQuads

Gets the series of Quads used for the particle sprites.

quads = ParticleSystem:getQuads()

quadstableA table containing the Quads used.

ParticleSystem:getRadialAcceleration

Gets the radial acceleration (away from the emitter).

min, max = ParticleSystem:getRadialAcceleration()

minnumberThe minimum acceleration.
maxnumberThe maximum acceleration.

ParticleSystem:getRotation

Gets the rotation of the image upon particle creation (in radians).

min, max = ParticleSystem:getRotation()

minnumberThe minimum initial angle (radians).
maxnumberThe maximum initial angle (radians).

ParticleSystem:getSizeVariation

Gets the amount of size variation (0 meaning no variation and 1 meaning full variation between start and end).

variation = ParticleSystem:getSizeVariation()

variationnumberThe amount of variation (0 meaning no variation and 1 meaning full variation between start and end).

ParticleSystem:getSizes

Gets the series of sizes by which the sprite is scaled. 1.0 is normal size. The particle system will interpolate between each size evenly over the particle's lifetime.

size1, size2, size8 = ParticleSystem:getSizes()

size1numberThe first size.
size2numberThe second size.
size8numberThe eighth size.

ParticleSystem:getSpeed

Gets the speed of the particles.

min, max = ParticleSystem:getSpeed()

minnumberThe minimum linear speed of the particles.
maxnumberThe maximum linear speed of the particles.

ParticleSystem:getSpin

Gets the spin of the sprite.

min, max, variation = ParticleSystem:getSpin()

minnumberThe minimum spin (radians per second).
maxnumberThe maximum spin (radians per second).
variationnumberThe degree of variation (0 meaning no variation and 1 meaning full variation between start and end).

ParticleSystem:getSpinVariation

Gets the amount of spin variation (0 meaning no variation and 1 meaning full variation between start and end).

variation = ParticleSystem:getSpinVariation()

variationnumberThe amount of variation (0 meaning no variation and 1 meaning full variation between start and end).

ParticleSystem:getSpread

Gets the amount of directional spread of the particle emitter (in radians).

spread = ParticleSystem:getSpread()

spreadnumberThe spread of the emitter (radians).

ParticleSystem:getTangentialAcceleration

Gets the tangential acceleration (acceleration perpendicular to the particle's direction).

min, max = ParticleSystem:getTangentialAcceleration()

minnumberThe minimum acceleration.
maxnumberThe maximum acceleration.

ParticleSystem:getTexture

Gets the texture (Image or Canvas) used for the particles.

texture = ParticleSystem:getTexture()

textureTextureThe Image or Canvas used for the particles.

ParticleSystem:hasRelativeRotation

Gets whether particle angles and rotations are relative to their velocities. If enabled, particles are aligned to the angle of their velocities and rotate relative to that angle.

enable = ParticleSystem:hasRelativeRotation()

enablebooleanTrue if relative particle rotation is enabled, false if it's disabled.

ParticleSystem:isActive

Checks whether the particle system is actively emitting particles.

active = ParticleSystem:isActive()

activebooleanTrue if system is active, false otherwise.

ParticleSystem:isPaused

Checks whether the particle system is paused.

paused = ParticleSystem:isPaused()

pausedbooleanTrue if system is paused, false otherwise.

ParticleSystem:isStopped

Checks whether the particle system is stopped.

stopped = ParticleSystem:isStopped()

stoppedbooleanTrue if system is stopped, false otherwise.

ParticleSystem:moveTo

Moves the position of the emitter. This results in smoother particle spawning behaviour than if ParticleSystem:setPosition is used every frame.

ParticleSystem:moveTo( x, y )

xnumberPosition along x-axis.
ynumberPosition along y-axis.

ParticleSystem:pause

Pauses the particle emitter.

ParticleSystem:pause()

ParticleSystem:reset

Resets the particle emitter, removing any existing particles and resetting the lifetime counter.

ParticleSystem:reset()

ParticleSystem:setBufferSize

Sets the size of the buffer (the max allowed amount of particles in the system).

ParticleSystem:setBufferSize( size )

sizenumberThe buffer size.

ParticleSystem:setColors

Sets a series of colors to apply to the particle sprite. The particle system will interpolate between each color evenly over the particle's lifetime.

Arguments can be passed in groups of four, representing the components of the desired RGBA value, or as tables of RGBA component values, with a default alpha value of 1 if only three values are given. At least one color must be specified. A maximum of eight may be used.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

ParticleSystem:setColors( r1, g1, b1, a1, r2, g2, b2, a2, r8, g8, b8, a8 )

r1numberFirst color, red component (0-1).
g1numberFirst color, green component (0-1).
b1numberFirst color, blue component (0-1).
a1numberFirst color, alpha component (0-1).
r2numberSecond color, red component (0-1).
g2numberSecond color, green component (0-1).
b2numberSecond color, blue component (0-1).
a2numberSecond color, alpha component (0-1).
r8numberEighth color, red component (0-1).
g8numberEighth color, green component (0-1).
b8numberEighth color, blue component (0-1).
a8numberEighth color, alpha component (0-1).

ParticleSystem:setDirection

Sets the direction the particles will be emitted in.

ParticleSystem:setDirection( direction )

directionnumberThe direction of the particles (in radians).

ParticleSystem:setEmissionArea

Sets area-based spawn parameters for the particles. Newly created particles will spawn in an area around the emitter based on the parameters to this function.

ParticleSystem:setEmissionArea( distribution, dx, dy, angle, directionRelativeToCenter )

distributionAreaSpreadDistributionThe type of distribution for new particles.
dxnumberThe maximum spawn distance from the emitter along the x-axis for uniform distribution, or the standard deviation along the x-axis for normal distribution.
dynumberThe maximum spawn distance from the emitter along the y-axis for uniform distribution, or the standard deviation along the y-axis for normal distribution.
angle (0)numberThe angle in radians of the emission area.
directionRelativeToCenter (false)booleanTrue if newly spawned particles will be oriented relative to the center of the emission area, false otherwise.

ParticleSystem:setEmissionRate

Sets the amount of particles emitted per second.

ParticleSystem:setEmissionRate( rate )

ratenumberThe amount of particles per second.

ParticleSystem:setEmitterLifetime

Sets how long the particle system should emit particles (if -1 then it emits particles forever).

ParticleSystem:setEmitterLifetime( life )

lifenumberThe lifetime of the emitter (in seconds).

ParticleSystem:setInsertMode

Sets the mode to use when the ParticleSystem adds new particles.

ParticleSystem:setInsertMode( mode )

modeParticleInsertModeThe mode to use when the ParticleSystem adds new particles.

ParticleSystem:setLinearAcceleration

Sets the linear acceleration (acceleration along the x and y axes) for particles.

Every particle created will accelerate along the x and y axes between xmin,ymin and xmax,ymax.

ParticleSystem:setLinearAcceleration( xmin, ymin, xmax, ymax )

xminnumberThe minimum acceleration along the x axis.
yminnumberThe minimum acceleration along the y axis.
xmax (xmin)numberThe maximum acceleration along the x axis.
ymax (ymin)numberThe maximum acceleration along the y axis.

ParticleSystem:setLinearDamping

Sets the amount of linear damping (constant deceleration) for particles.

ParticleSystem:setLinearDamping( min, max )

minnumberThe minimum amount of linear damping applied to particles.
max (min)numberThe maximum amount of linear damping applied to particles.

ParticleSystem:setOffset

Set the offset position which the particle sprite is rotated around.

If this function is not used, the particles rotate around their center.

ParticleSystem:setOffset( x, y )

xnumberThe x coordinate of the rotation offset.
ynumberThe y coordinate of the rotation offset.

ParticleSystem:setParticleLifetime

Sets the lifetime of the particles.

ParticleSystem:setParticleLifetime( min, max )

minnumberThe minimum life of the particles (in seconds).
max (min)numberThe maximum life of the particles (in seconds).

ParticleSystem:setPosition

Sets the position of the emitter.

ParticleSystem:setPosition( x, y )

xnumberPosition along x-axis.
ynumberPosition along y-axis.

ParticleSystem:setQuads

Sets a series of Quads to use for the particle sprites. Particles will choose a Quad from the list based on the particle's current lifetime, allowing for the use of animated sprite sheets with ParticleSystems.

ParticleSystem:setQuads( quad1, quad2 )

quad1QuadThe first Quad to use.
quad2QuadThe second Quad to use.

ParticleSystem:setQuads( quads )

quadstableA table containing the Quads to use.

ParticleSystem:setRadialAcceleration

Set the radial acceleration (away from the emitter).

ParticleSystem:setRadialAcceleration( min, max )

minnumberThe minimum acceleration.
max (min)numberThe maximum acceleration.

ParticleSystem:setRelativeRotation

Sets whether particle angles and rotations are relative to their velocities. If enabled, particles are aligned to the angle of their velocities and rotate relative to that angle.

ParticleSystem:setRelativeRotation( enable )

enablebooleanTrue to enable relative particle rotation, false to disable it.

ParticleSystem:setRotation

Sets the rotation of the image upon particle creation (in radians).

ParticleSystem:setRotation( min, max )

minnumberThe minimum initial angle (radians).
max (min)numberThe maximum initial angle (radians).

ParticleSystem:setSizeVariation

Sets the amount of size variation (0 meaning no variation and 1 meaning full variation between start and end).

ParticleSystem:setSizeVariation( variation )

variationnumberThe amount of variation (0 meaning no variation and 1 meaning full variation between start and end).

ParticleSystem:setSizes

Sets a series of sizes by which to scale a particle sprite. 1.0 is normal size. The particle system will interpolate between each size evenly over the particle's lifetime.

At least one size must be specified. A maximum of eight may be used.

ParticleSystem:setSizes( size1, size2, size8 )

size1numberThe first size.
size2numberThe second size.
size8numberThe eighth size.

ParticleSystem:setSpeed

Sets the speed of the particles.

ParticleSystem:setSpeed( min, max )

minnumberThe minimum linear speed of the particles.
max (min)numberThe maximum linear speed of the particles.

ParticleSystem:setSpin

Sets the spin of the sprite.

ParticleSystem:setSpin( min, max )

minnumberThe minimum spin (radians per second).
max (min)numberThe maximum spin (radians per second).

ParticleSystem:setSpinVariation

Sets the amount of spin variation (0 meaning no variation and 1 meaning full variation between start and end).

ParticleSystem:setSpinVariation( variation )

variationnumberThe amount of variation (0 meaning no variation and 1 meaning full variation between start and end).

ParticleSystem:setSpread

Sets the amount of spread for the system.

ParticleSystem:setSpread( spread )

spreadnumberThe amount of spread (radians).

ParticleSystem:setTangentialAcceleration

Sets the tangential acceleration (acceleration perpendicular to the particle's direction).

ParticleSystem:setTangentialAcceleration( min, max )

minnumberThe minimum acceleration.
max (min)numberThe maximum acceleration.

ParticleSystem:setTexture

Sets the texture (Image or Canvas) to be used for the particles.

ParticleSystem:setTexture( texture )

textureTextureAn Image or Canvas to use for the particles.

ParticleSystem:start

Starts the particle emitter.

ParticleSystem:start()

ParticleSystem:stop

Stops the particle emitter, resetting the lifetime counter.

ParticleSystem:stop()

ParticleSystem:update

Updates the particle system; moving, creating and killing particles.

ParticleSystem:update( dt )

dtnumberThe time (seconds) since last frame.

Quad:getTextureDimensions

Gets reference texture dimensions initially specified in love.graphics.newQuad.

sw, sh = Quad:getTextureDimensions()

swnumberThe Texture width used by the Quad.
shnumberThe Texture height used by the Quad.

Quad:getViewport

Gets the current viewport of this Quad.

x, y, w, h = Quad:getViewport()

xnumberThe top-left corner along the x-axis.
ynumberThe top-left corner along the y-axis.
wnumberThe width of the viewport.
hnumberThe height of the viewport.

Quad:setViewport

Sets the texture coordinates according to a viewport.

Quad:setViewport( x, y, w, h, sw, sh )

xnumberThe top-left corner along the x-axis.
ynumberThe top-left corner along the y-axis.
wnumberThe width of the viewport.
hnumberThe height of the viewport.
swnumberThe reference width, the width of the Image. (Must be greater than 0.)
shnumberThe reference height, the height of the Image. (Must be greater than 0.)

Shader:getWarnings

Returns any warning and error messages from compiling the shader code. This can be used for debugging your shaders if there's anything the graphics hardware doesn't like.

warnings = Shader:getWarnings()

warningsstringWarning and error messages (if any).

Shader:hasUniform

Gets whether a uniform / extern variable exists in the Shader.

If a graphics driver's shader compiler determines that a uniform / extern variable doesn't affect the final output of the shader, it may optimize the variable out. This function will return false in that case.

hasuniform = Shader:hasUniform( name )

hasuniformbooleanWhether the uniform exists in the shader and affects its final output.
namestringThe name of the uniform variable.

Shader:send

Sends one or more values to a special (''uniform'') variable inside the shader. Uniform variables have to be marked using the ''uniform'' or ''extern'' keyword, e.g.

uniform float time; // 'float' is the typical number type used in GLSL shaders.

uniform float varsvec2 light_pos;

uniform vec4 colors[4;

The corresponding send calls would be

shader:send('time', t)

shader:send('vars',a,b)

shader:send('light_pos', {light_x, light_y})

shader:send('colors', {r1, g1, b1, a1}, {r2, g2, b2, a2}, {r3, g3, b3, a3}, {r4, g4, b4, a4})

Uniform / extern variables are read-only in the shader code and remain constant until modified by a Shader:send call. Uniform variables can be accessed in both the Vertex and Pixel components of a shader, as long as the variable is declared in each.

Shader:send( name, number, ... )

namestringName of the number to send to the shader.
numbernumberNumber to send to store in the uniform variable.
...numberAdditional numbers to send if the uniform variable is an array.

Shader:send( name, vector, ... )

namestringName of the vector to send to the shader.
vectortableNumbers to send to the uniform variable as a vector. The number of elements in the table determines the type of the vector (e.g. two numbers -> vec2). At least two and at most four numbers can be used.
...tableAdditional vectors to send if the uniform variable is an array. All vectors need to be of the same size (e.g. only vec3's).

Shader:send( name, matrix, ... )

namestringName of the matrix to send to the shader.
matrixtable2x2, 3x3, or 4x4 matrix to send to the uniform variable. Using table form: {{a,b,c,d}, {e,f,g,h}, ... } or (since version 0.10.2) {a,b,c,d, e,f,g,h, ...}. The order in 0.10.2 is column-major; starting in 11.0 it's row-major instead.
...tableAdditional matrices of the same type as ''matrix'' to store in a uniform array.

Shader:send( name, texture )

namestringName of the Texture to send to the shader.
textureTextureTexture (Image or Canvas) to send to the uniform variable.

Shader:send( name, boolean, ... )

namestringName of the boolean to send to the shader.
booleanbooleanBoolean to send to store in the uniform variable.
...booleanAdditional booleans to send if the uniform variable is an array.

Shader:send( name, matrixlayout, matrix, ... )

namestringName of the matrix to send to the shader.
matrixlayoutMatrixLayoutThe layout (row- or column-major) of the matrix.
matrixtable2x2, 3x3, or 4x4 matrix to send to the uniform variable. Using table form: {{a,b,c,d}, {e,f,g,h}, ... } or {a,b,c,d, e,f,g,h, ...}.
...tableAdditional matrices of the same type as ''matrix'' to store in a uniform array.

Shader:send( name, data, offset, size )

namestringName of the uniform to send to the shader.
dataDataData object containing the values to send.
offset (0)numberOffset in bytes from the start of the Data object.
size (all)numberSize in bytes of the data to send. If nil, as many bytes as the specified uniform uses will be copied.

Shader:send( name, data, matrixlayout, offset, size )

namestringName of the uniform matrix to send to the shader.
dataDataData object containing the values to send.
matrixlayoutMatrixLayoutThe layout (row- or column-major) of the matrix in memory.
offset (0)numberOffset in bytes from the start of the Data object.
size (all)numberSize in bytes of the data to send. If nil, as many bytes as the specified uniform uses will be copied.

Shader:sendColor

Sends one or more colors to a special (''extern'' / ''uniform'') vec3 or vec4 variable inside the shader. The color components must be in the range of 1. The colors are gamma-corrected if global gamma-correction is enabled.

Extern variables must be marked using the ''extern'' keyword, e.g.

extern vec4 Color;

The corresponding sendColor call would be

shader:sendColor('Color', {r, g, b, a})

Extern variables can be accessed in both the Vertex and Pixel stages of a shader, as long as the variable is declared in each.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

Shader:sendColor( name, color, ... )

namestringThe name of the color extern variable to send to in the shader.
colortableA table with red, green, blue, and optional alpha color components in the range of 1 to send to the extern as a vector.
...tableAdditional colors to send in case the extern is an array. All colors need to be of the same size (e.g. only vec3's).

SpriteBatch:add

Adds a sprite to the batch. Sprites are drawn in the order they are added.

id = SpriteBatch:add( x, y, r, sx, sy, ox, oy, kx, ky )

idnumberAn identifier for the added sprite.
xnumberThe position to draw the object (x-axis).
ynumberThe position to draw the object (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShear factor (x-axis).
ky (0)numberShear factor (y-axis).

id = SpriteBatch:add( quad, x, y, r, sx, sy, ox, oy, kx, ky )

idnumberAn identifier for the added sprite.
quadQuadThe Quad to add.
xnumberThe position to draw the object (x-axis).
ynumberThe position to draw the object (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShear factor (x-axis).
ky (0)numberShear factor (y-axis).

SpriteBatch:addLayer

Adds a sprite to a batch created with an Array Texture.

spriteindex = SpriteBatch:addLayer( layerindex, x, y, r, sx, sy, ox, oy, kx, ky )

spriteindexnumberThe index of the added sprite, for use with SpriteBatch:set or SpriteBatch:setLayer.
layerindexnumberThe index of the layer to use for this sprite.
x (0)numberThe position to draw the sprite (x-axis).
y (0)numberThe position to draw the sprite (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

spriteindex = SpriteBatch:addLayer( layerindex, quad, x, y, r, sx, sy, ox, oy, kx, ky )

spriteindexnumberThe index of the added sprite, for use with SpriteBatch:set or SpriteBatch:setLayer.
layerindexnumberThe index of the layer to use for this sprite.
quadQuadThe subsection of the texture's layer to use when drawing the sprite.
x (0)numberThe position to draw the sprite (x-axis).
y (0)numberThe position to draw the sprite (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

spriteindex = SpriteBatch:addLayer( layerindex, transform )

spriteindexnumberThe index of the added sprite, for use with SpriteBatch:set or SpriteBatch:setLayer.
layerindexnumberThe index of the layer to use for this sprite.
transformTransformA transform object.

spriteindex = SpriteBatch:addLayer( layerindex, quad, transform )

spriteindexnumberThe index of the added sprite, for use with SpriteBatch:set or SpriteBatch:setLayer.
layerindexnumberThe index of the layer to use for this sprite.
quadQuadThe subsection of the texture's layer to use when drawing the sprite.
transformTransformA transform object.

SpriteBatch:attachAttribute

Attaches a per-vertex attribute from a Mesh onto this SpriteBatch, for use when drawing. This can be combined with a Shader to augment a SpriteBatch with per-vertex or additional per-sprite information instead of just having per-sprite colors.

Each sprite in a SpriteBatch has 4 vertices in the following order: top-left, bottom-left, top-right, bottom-right. The index returned by SpriteBatch:add (and used by SpriteBatch:set) can used to determine the first vertex of a specific sprite with the formula 1 + 4 * ( id - 1 ).

SpriteBatch:attachAttribute( name, mesh )

namestringThe name of the vertex attribute to attach.
meshMeshThe Mesh to get the vertex attribute from.

SpriteBatch:clear

Removes all sprites from the buffer.

SpriteBatch:clear()

SpriteBatch:flush

Immediately sends all new and modified sprite data in the batch to the graphics card.

Normally it isn't necessary to call this method as love.graphics.draw(spritebatch, ...) will do it automatically if needed, but explicitly using SpriteBatch:flush gives more control over when the work happens.

If this method is used, it generally shouldn't be called more than once (at most) between love.graphics.draw(spritebatch, ...) calls.

SpriteBatch:flush()

SpriteBatch:getBufferSize

Gets the maximum number of sprites the SpriteBatch can hold.

size = SpriteBatch:getBufferSize()

sizenumberThe maximum number of sprites the batch can hold.

SpriteBatch:getColor

Gets the color that will be used for the next add and set operations.

If no color has been set with SpriteBatch:setColor or the current SpriteBatch color has been cleared, this method will return nil.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

r, g, b, a = SpriteBatch:getColor()

rnumberThe red component (0-1).
gnumberThe green component (0-1).
bnumberThe blue component (0-1).
anumberThe alpha component (0-1).

SpriteBatch:getCount

Gets the number of sprites currently in the SpriteBatch.

count = SpriteBatch:getCount()

countnumberThe number of sprites currently in the batch.

SpriteBatch:getTexture

Gets the texture (Image or Canvas) used by the SpriteBatch.

texture = SpriteBatch:getTexture()

textureTextureThe Image or Canvas used by the SpriteBatch.

SpriteBatch:set

Changes a sprite in the batch. This requires the sprite index returned by SpriteBatch:add or SpriteBatch:addLayer.

SpriteBatch:set( spriteindex, x, y, r, sx, sy, ox, oy, kx, ky )

spriteindexnumberThe index of the sprite that will be changed.
xnumberThe position to draw the object (x-axis).
ynumberThe position to draw the object (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShear factor (x-axis).
ky (0)numberShear factor (y-axis).

SpriteBatch:set( spriteindex, quad, x, y, r, sx, sy, ox, oy, kx, ky )

spriteindexnumberThe index of the sprite that will be changed.
quadQuadThe Quad used on the image of the batch.
xnumberThe position to draw the object (x-axis).
ynumberThe position to draw the object (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShear factor (x-axis).
ky (0)numberShear factor (y-axis).

SpriteBatch:setColor

Sets the color that will be used for the next add and set operations. Calling the function without arguments will disable all per-sprite colors for the SpriteBatch.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

In version 0.9.2 and older, the global color set with love.graphics.setColor will not work on the SpriteBatch if any of the sprites has its own color.

SpriteBatch:setColor( r, g, b, a )

rnumberThe amount of red.
gnumberThe amount of green.
bnumberThe amount of blue.
a (1)numberThe amount of alpha.

SpriteBatch:setColor()

SpriteBatch:setDrawRange

Restricts the drawn sprites in the SpriteBatch to a subset of the total.

SpriteBatch:setDrawRange( start, count )

startnumberThe index of the first sprite to draw. Index 1 corresponds to the first sprite added with SpriteBatch:add.
countnumberThe number of sprites to draw.

SpriteBatch:setDrawRange()

SpriteBatch:setLayer

Changes a sprite previously added with add or addLayer, in a batch created with an Array Texture.

SpriteBatch:setLayer( spriteindex, layerindex, x, y, r, sx, sy, ox, oy, kx, ky )

spriteindexnumberThe index of the existing sprite to replace.
layerindexnumberThe index of the layer in the Array Texture to use for this sprite.
x (0)numberThe position to draw the sprite (x-axis).
y (0)numberThe position to draw the sprite (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

SpriteBatch:setLayer( spriteindex, layerindex, quad, x, y, r, sx, sy, ox, oy, kx, ky )

spriteindexnumberThe index of the existing sprite to replace.
layerindexnumberThe index of the layer to use for this sprite.
quadQuadThe subsection of the texture's layer to use when drawing the sprite.
x (0)numberThe position to draw the sprite (x-axis).
y (0)numberThe position to draw the sprite (y-axis).
r (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing factor (x-axis).
ky (0)numberShearing factor (y-axis).

SpriteBatch:setLayer( spriteindex, layerindex, transform )

spriteindexnumberThe index of the existing sprite to replace.
layerindexnumberThe index of the layer to use for the sprite.
transformTransformA transform object.

SpriteBatch:setLayer( spriteindex, layerindex, quad, transform )

spriteindexnumberThe index of the existing sprite to replace.
layerindexnumberThe index of the layer to use for the sprite.
quadQuadThe subsection of the texture's layer to use when drawing the sprite.
transformTransformA transform object.

SpriteBatch:setTexture

Sets the texture (Image or Canvas) used for the sprites in the batch, when drawing.

SpriteBatch:setTexture( texture )

textureTextureThe new Image or Canvas to use for the sprites in the batch.

Text:add

Adds additional colored text to the Text object at the specified position.

index = Text:add( textstring, x, y, angle, sx, sy, ox, oy, kx, ky )

indexnumberAn index number that can be used with Text:getWidth or Text:getHeight.
textstringstringThe text to add to the object.
x (0)numberThe position of the new text on the x-axis.
y (0)numberThe position of the new text on the y-axis.
angle (0)numberThe orientation of the new text in radians.
sx (1)numberScale factor on the x-axis.
sy (sx)numberScale factor on the y-axis.
ox (0)numberOrigin offset on the x-axis.
oy (0)numberOrigin offset on the y-axis.
kx (0)numberShearing / skew factor on the x-axis.
ky (0)numberShearing / skew factor on the y-axis.

index = Text:add( coloredtext, x, y, angle, sx, sy, ox, oy, kx, ky )

indexnumberAn index number that can be used with Text:getWidth or Text:getHeight.
coloredtexttableA table containing colors and strings to add to the object, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1stringA string of text which has a color specified by the previous color.
coloredtext.color2tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2stringA string of text which has a color specified by the previous color.
coloredtext....tables and stringsAdditional colors and strings.
x (0)numberThe position of the new text on the x-axis.
y (0)numberThe position of the new text on the y-axis.
angle (0)numberThe orientation of the new text in radians.
sx (1)numberScale factor on the x-axis.
sy (sx)numberScale factor on the y-axis.
ox (0)numberOrigin offset on the x-axis.
oy (0)numberOrigin offset on the y-axis.
kx (0)numberShearing / skew factor on the x-axis.
ky (0)numberShearing / skew factor on the y-axis.

Text:addf

Adds additional formatted / colored text to the Text object at the specified position.

The word wrap limit is applied before any scaling, rotation, and other coordinate transformations. Therefore the amount of text per line stays constant given the same wrap limit, even if the scale arguments change.

index = Text:addf( textstring, wraplimit, align, x, y, angle, sx, sy, ox, oy, kx, ky )

indexnumberAn index number that can be used with Text:getWidth or Text:getHeight.
textstringstringThe text to add to the object.
wraplimitnumberThe maximum width in pixels of the text before it gets automatically wrapped to a new line.
alignAlignModeThe alignment of the text.
xnumberThe position of the new text (x-axis).
ynumberThe position of the new text (y-axis).
angle (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing / skew factor (x-axis).
ky (0)numberShearing / skew factor (y-axis).

index = Text:addf( coloredtext, wraplimit, align, x, y, angle, sx, sy, ox, oy, kx, ky )

indexnumberAn index number that can be used with Text:getWidth or Text:getHeight.
coloredtexttableA table containing colors and strings to add to the object, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1stringA string of text which has a color specified by the previous color.
coloredtext.color2tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2stringA string of text which has a color specified by the previous color.
coloredtext....tables and stringsAdditional colors and strings.
wraplimitnumberThe maximum width in pixels of the text before it gets automatically wrapped to a new line.
alignAlignModeThe alignment of the text.
xnumberThe position of the new text (x-axis).
ynumberThe position of the new text (y-axis).
angle (0)numberOrientation (radians).
sx (1)numberScale factor (x-axis).
sy (sx)numberScale factor (y-axis).
ox (0)numberOrigin offset (x-axis).
oy (0)numberOrigin offset (y-axis).
kx (0)numberShearing / skew factor (x-axis).
ky (0)numberShearing / skew factor (y-axis).

Text:clear

Clears the contents of the Text object.

Text:clear()

Text:getDimensions

Gets the width and height of the text in pixels.

width, height = Text:getDimensions()

widthnumberThe width of the text. If multiple sub-strings have been added with Text:add, the width of the last sub-string is returned.
heightnumberThe height of the text. If multiple sub-strings have been added with Text:add, the height of the last sub-string is returned.

width, height = Text:getDimensions( index )

widthnumberThe width of the sub-string (before scaling and other transformations).
heightnumberThe height of the sub-string (before scaling and other transformations).
indexnumberAn index number returned by Text:add or Text:addf.

Text:getFont

Gets the Font used with the Text object.

font = Text:getFont()

fontFontThe font used with this Text object.

Text:getHeight

Gets the height of the text in pixels.

height = Text:getHeight()

height numberThe height of the text. If multiple sub-strings have been added with Text:add, the height of the last sub-string is returned.

height = Text:getHeight( index )

heightnumberThe height of the sub-string (before scaling and other transformations).
indexnumberAn index number returned by Text:add or Text:addf.

Text:getWidth

Gets the width of the text in pixels.

width = Text:getWidth()

widthnumberThe width of the text. If multiple sub-strings have been added with Text:add, the width of the last sub-string is returned.

width = Text:getWidth( index )

widthnumberThe width of the sub-string (before scaling and other transformations).
indexnumberAn index number returned by Text:add or Text:addf.

Text:set

Replaces the contents of the Text object with a new unformatted string.

Text:set( textstring )

textstringstringThe new string of text to use.

Text:set( coloredtext )

coloredtexttableA table containing colors and strings to use as the new text, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1stringA string of text which has a color specified by the previous color.
coloredtext.color2tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2stringA string of text which has a color specified by the previous color.
coloredtext....tables and stringsAdditional colors and strings.

Text:setFont

Replaces the Font used with the text.

Text:setFont( font )

fontFontThe new font to use with this Text object.

Text:setf

Replaces the contents of the Text object with a new formatted string.

Text:setf( textstring, wraplimit, align )

textstringstringThe new string of text to use.
wraplimitnumberThe maximum width in pixels of the text before it gets automatically wrapped to a new line.
alignAlignModeThe alignment of the text.

Text:setf( coloredtext, wraplimit, align )

coloredtexttableA table containing colors and strings to use as the new text, in the form of {color1, string1, color2, string2, ...}.
coloredtext.color1tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string1stringA string of text which has a color specified by the previous color.
coloredtext.color2tableA table containing red, green, blue, and optional alpha components to use as a color for the next string in the table, in the form of {red, green, blue, alpha}.
coloredtext.string2stringA string of text which has a color specified by the previous color.
coloredtext....tables and stringsAdditional colors and strings.
wraplimitnumberThe maximum width in pixels of the text before it gets automatically wrapped to a new line.
alignAlignModeThe alignment of the text.

Texture:getDPIScale

Gets the DPI scale factor of the Texture.

The DPI scale factor represents relative pixel density. A DPI scale factor of 2 means the texture has twice the pixel density in each dimension (4 times as many pixels in the same area) compared to a texture with a DPI scale factor of 1.

For example, a texture with pixel dimensions of 100x100 with a DPI scale factor of 2 will be drawn as if it was 50x50. This is useful with high-dpi / retina displays to easily allow swapping out higher or lower pixel density Images and Canvases without needing any extra manual scaling logic.

dpiscale = Texture:getDPIScale()

dpiscalenumberThe DPI scale factor of the Texture.

Texture:getDepth

Gets the depth of a Volume Texture. Returns 1 for 2D, Cubemap, and Array textures.

depth = Texture:getDepth()

depthnumberThe depth of the volume Texture.

Texture:getFormat

Gets the pixel format of the Texture.

format = Texture:getFormat()

formatPixelFormatThe pixel format the Texture was created with.

Texture:getLayerCount

Gets the number of layers / slices in an Array Texture. Returns 1 for 2D, Cubemap, and Volume textures.

layers = Texture:getLayerCount()

layersnumberThe number of layers in the Array Texture.

Texture:getMipmapCount

Gets the number of mipmaps contained in the Texture. If the texture was not created with mipmaps, it will return 1.

mipmaps = Texture:getMipmapCount()

mipmapsnumberThe number of mipmaps in the Texture.

Texture:getMipmapFilter

Gets the mipmap filter mode for a Texture. Prior to 11.0 this method only worked on Images.

mode, sharpness = Texture:getMipmapFilter()

modeFilterModeThe filter mode used in between mipmap levels. nil if mipmap filtering is not enabled.
sharpnessnumberValue used to determine whether the image should use more or less detailed mipmap levels than normal when drawing.

Texture:getPixelHeight

Gets the height in pixels of the Texture.

DPI scale factor, rather than pixels. Use getHeight for calculations related to drawing the texture (calculating an origin offset, for example), and getPixelHeight only when dealing specifically with pixels, for example when using Canvas:newImageData.

pixelheight = Texture:getPixelHeight()

pixelheightnumberThe height of the Texture, in pixels.

Texture:getPixelWidth

Gets the width in pixels of the Texture.

DPI scale factor, rather than pixels. Use getWidth for calculations related to drawing the texture (calculating an origin offset, for example), and getPixelWidth only when dealing specifically with pixels, for example when using Canvas:newImageData.

pixelwidth = Texture:getPixelWidth()

pixelwidthnumberThe width of the Texture, in pixels.

Texture:getTextureType

Gets the type of the Texture.

texturetype = Texture:getTextureType()

texturetypeTextureTypeThe type of the Texture.

Texture:isReadable

Gets whether the Texture can be drawn and sent to a Shader.

Canvases created with stencil and/or depth PixelFormats are not readable by default, unless readable=true is specified in the settings table passed into love.graphics.newCanvas.

Non-readable Canvases can still be rendered to.

readable = Texture:isReadable()

readablebooleanWhether the Texture is readable.

Texture:setMipmapFilter

Sets the mipmap filter mode for a Texture. Prior to 11.0 this method only worked on Images.

Mipmapping is useful when drawing a texture at a reduced scale. It can improve performance and reduce aliasing issues.

In created with the mipmaps flag enabled for the mipmap filter to have any effect. In versions prior to 0.10.0 it's best to call this method directly after creating the image with love.graphics.newImage, to avoid bugs in certain graphics drivers.

Due to hardware restrictions and driver bugs, in versions prior to 0.10.0 images that weren't loaded from a CompressedData must have power-of-two dimensions (64x64, 512x256, etc.) to use mipmaps.

Texture:setMipmapFilter( filtermode, sharpness )

filtermodeFilterModeThe filter mode to use in between mipmap levels. 'nearest' will often give better performance.
sharpness (0)numberA positive sharpness value makes the texture use a more detailed mipmap level when drawing, at the expense of performance. A negative value does the reverse.

Texture:setMipmapFilter()

Video:getDimensions

Gets the width and height of the Video in pixels.

width, height = Video:getDimensions()

widthnumberThe width of the Video.
heightnumberThe height of the Video.

Video:getFilter

Gets the scaling filters used when drawing the Video.

min, mag, anisotropy = Video:getFilter()

minFilterModeThe filter mode used when scaling the Video down.
magFilterModeThe filter mode used when scaling the Video up.
anisotropynumberMaximum amount of anisotropic filtering used.

Video:getHeight

Gets the height of the Video in pixels.

height = Video:getHeight()

heightnumberThe height of the Video.

Video:getSource

Gets the audio Source used for playing back the video's audio. May return nil if the video has no audio, or if Video:setSource is called with a nil argument.

source = Video:getSource()

sourceSourceThe audio Source used for audio playback, or nil if the video has no audio.

Video:getStream

Gets the VideoStream object used for decoding and controlling the video.

stream = Video:getStream()

streamVideoStreamThe VideoStream used for decoding and controlling the video.

Video:getWidth

Gets the width of the Video in pixels.

width = Video:getWidth()

widthnumberThe width of the Video.

Video:isPlaying

Gets whether the Video is currently playing.

playing = Video:isPlaying()

playingbooleanWhether the video is playing.

Video:pause

Pauses the Video.

Video:pause()

Video:play

Starts playing the Video. In order for the video to appear onscreen it must be drawn with love.graphics.draw.

Video:play()

Video:rewind

Rewinds the Video to the beginning.

Video:rewind()

Video:seek

Sets the current playback position of the Video.

Video:seek( offset )

offsetnumberThe time in seconds since the beginning of the Video.

Video:setFilter

Sets the scaling filters used when drawing the Video.

Video:setFilter( min, mag, anisotropy )

minFilterModeThe filter mode used when scaling the Video down.
magFilterModeThe filter mode used when scaling the Video up.
anisotropy (1)numberMaximum amount of anisotropic filtering used.

Video:setSource

Sets the audio Source used for playing back the video's audio. The audio Source also controls playback speed and synchronization.

Video:setSource( source )

source (nil)SourceThe audio Source used for audio playback, or nil to disable audio synchronization.

Video:tell

Gets the current playback position of the Video.

seconds = Video:tell()

secondsnumberThe time in seconds since the beginning of the Video.

AlignMode

center

Align text center.

left

Align text left.

right

Align text right.

justify

Align text both left and right.

ArcType

pie

The arc is drawn like a slice of pie, with the arc circle connected to the center at its end-points.

open

The arc circle's two end-points are unconnected when the arc is drawn as a line. Behaves like the "closed" arc type when the arc is drawn in filled mode.

closed

The arc circle's two end-points are connected to each other.

AreaSpreadDistribution

uniform

Uniform distribution.

normal

Normal (gaussian) distribution.

ellipse

Uniform distribution in an ellipse.

borderellipse

Distribution in an ellipse with particles spawning at the edges of the ellipse.

borderrectangle

Distribution in a rectangle with particles spawning at the edges of the rectangle.

none

No distribution - area spread is disabled.

BlendAlphaMode

alphamultiply

The RGB values of what's drawn are multiplied by the alpha values of those colors during blending. This is the default alpha mode.

premultiplied

The RGB values of what's drawn are '''not''' multiplied by the alpha values of those colors during blending. For most blend modes to work correctly with this alpha mode, the colors of a drawn object need to have had their RGB values multiplied by their alpha values at some point previously ("premultiplied alpha").

BlendMode

alpha

Alpha blending (normal). The alpha of what's drawn determines its opacity.

replace

The colors of what's drawn completely replace what was on the screen, with no additional blending. The BlendAlphaMode specified in love.graphics.setBlendMode still affects what happens.

screen

'Screen' blending.

add

The pixel colors of what's drawn are added to the pixel colors already on the screen. The alpha of the screen is not modified.

subtract

The pixel colors of what's drawn are subtracted from the pixel colors already on the screen. The alpha of the screen is not modified.

multiply

The pixel colors of what's drawn are multiplied with the pixel colors already on the screen (darkening them). The alpha of drawn objects is multiplied with the alpha of the screen rather than determining how much the colors on the screen are affected, even when the "alphamultiply" BlendAlphaMode is used.

lighten

The pixel colors of what's drawn are compared to the existing pixel colors, and the larger of the two values for each color component is used. Only works when the "premultiplied" BlendAlphaMode is used in love.graphics.setBlendMode.

darken

The pixel colors of what's drawn are compared to the existing pixel colors, and the smaller of the two values for each color component is used. Only works when the "premultiplied" BlendAlphaMode is used in love.graphics.setBlendMode.

additive

Additive blend mode.

subtractive

Subtractive blend mode.

multiplicative

Multiply blend mode.

premultiplied

Premultiplied alpha blend mode.

CanvasMipmapMode

none

Do not enable mipmap.

auto

Automatically generate mipmap.

manual

Let user manually generate mipmap.

CompareMode

never

Objects will never be drawn.

always

Objects will always be drawn. Effectively disables the depth or stencil test.

CullMode

back

Back-facing triangles in Meshes are culled (not rendered). The vertex order of a triangle determines whether it is back- or front-facing.

front

Front-facing triangles in Meshes are culled.

none

Both back- and front-facing triangles in Meshes are rendered.

DrawMode

fill

Draw filled shape.

line

Draw outlined shape.

FilterMode

linear

Scale image with linear interpolation.

nearest

Scale image with nearest neighbor interpolation.

GraphicsFeature

clampzero

Whether the "clampzero" WrapMode is supported.

lighten

Whether the "lighten" and "darken" BlendModes are supported.

multicanvasformats

Whether multiple formats can be used in the same love.graphics.setCanvas call.

glsl3

Whether GLSL 3 Shaders can be used.

instancing

Whether mesh instancing is supported.

fullnpot

Whether textures with non-power-of-two dimensions can use mipmapping and the 'repeat' WrapMode.

pixelshaderhighp

Whether pixel shaders can use "highp" 32 bit floating point numbers (as opposed to just 16 bit or lower precision).

shaderderivatives

Whether shaders can use the dFdx, dFdy, and fwidth functions for computing derivatives.

canvas

Support for Canvas.

npot

Support for textures with non-power-of-two sizes. See PO2 Syndrome.

subtractive

Support for the subtractive blend mode.

shader

Support for Shaders.

hdrcanvas

Support for HDR Canvases. Use love.graphics.getCanvasFormats instead.

multicanvas

Support for simultaneous rendering to at least 4 canvases at once, with love.graphics.setCanvas. Use love.graphics.getSystemLimits instead.

mipmap

Support for Mipmaps.

dxt

Support for DXT compressed images (see CompressedFormat.) Use love.graphics.getCompressedImageFormats instead.

bc5

Support for BC4 and BC5 compressed images. Use love.graphics.getCompressedImageFormats instead.

srgb

Support for gamma-correct rendering with the srgb window flag in Canvases and Images.

pixeleffect

Support for PixelEffects.

GraphicsLimit

pointsize

The maximum size of points.

texturesize

The maximum width or height of Images and Canvases.

multicanvas

The maximum number of simultaneously active canvases (via love.graphics.setCanvas.)

canvasmsaa

The maximum number of antialiasing samples for a Canvas.

texturelayers

The maximum number of layers in an Array texture.

volumetexturesize

The maximum width, height, or depth of a Volume texture.

cubetexturesize

The maximum width or height of a Cubemap texture.

anisotropy

The maximum amount of anisotropic filtering. Texture:setMipmapFilter internally clamps the given anisotropy value to the system's limit.

canvasfsaa

The maximum number of antialiasing samples for a Canvas.

LineJoin

miter

The ends of the line segments beveled in an angle so that they join seamlessly.

none

No cap applied to the ends of the line segments.

bevel

Flattens the point where line segments join together.

LineStyle

rough

Draw rough lines.

smooth

Draw smooth lines.

MatrixLayout

row

The matrix is row-major:

column

The matrix is column-major:

MeshDrawMode

fan

The vertices create a "fan" shape with the first vertex acting as the hub point. Can be easily used to draw simple convex polygons.

strip

The vertices create a series of connected triangles using vertices 1, 2, 3, then 3, 2, 4 (note the order), then 3, 4, 5, and so on.

triangles

The vertices create unconnected triangles.

points

The vertices are drawn as unconnected points (see love.graphics.setPointSize.)

ParticleInsertMode

top

Particles are inserted at the top of the ParticleSystem's list of particles.

bottom

Particles are inserted at the bottom of the ParticleSystem's list of particles.

random

Particles are inserted at random positions in the ParticleSystem's list of particles.

SpriteBatchUsage

dynamic

The object's data will change occasionally during its lifetime.

static

The object will not be modified after initial sprites or vertices are added.

stream

The object data will always change between draws.

StackType

transform

The transformation stack (love.graphics.translate, love.graphics.rotate, etc.)

all

All love.graphics state, including transform state.

StencilAction

replace

The stencil value of a pixel will be replaced by the value specified in love.graphics.stencil, if any object touches the pixel.

increment

The stencil value of a pixel will be incremented by 1 for each object that touches the pixel. If the stencil value reaches 255 it will stay at 255.

decrement

The stencil value of a pixel will be decremented by 1 for each object that touches the pixel. If the stencil value reaches 0 it will stay at 0.

incrementwrap

The stencil value of a pixel will be incremented by 1 for each object that touches the pixel. If a stencil value of 255 is incremented it will be set to 0.

decrementwrap

The stencil value of a pixel will be decremented by 1 for each object that touches the pixel. If the stencil value of 0 is decremented it will be set to 255.

invert

The stencil value of a pixel will be bitwise-inverted for each object that touches the pixel. If a stencil value of 0 is inverted it will become 255.

TextureType

2d

Regular 2D texture with width and height.

array

Several same-size 2D textures organized into a single object. Similar to a texture atlas / sprite sheet, but avoids sprite bleeding and other issues.

cube

Cubemap texture with 6 faces. Requires a custom shader (and Shader:send) to use. Sampling from a cube texture in a shader takes a 3D direction vector instead of a texture coordinate.

volume

3D texture with width, height, and depth. Requires a custom shader to use. Volume textures can have texture filtering applied along the 3rd axis.

WrapMode

clamp

Clamp the texture. Appears only once. The area outside the texture's normal range is colored based on the edge pixels of the texture.

repeat

Repeat the texture. Fills the whole available extent.

mirroredrepeat

Repeat the texture, flipping it each time it repeats. May produce better visual results than the repeat mode when the texture doesn't seamlessly tile.

clampzero

Clamp the texture. Fills the area outside the texture's normal range with transparent black (or opaque black for textures with no alpha channel.)

love.image

love.image.isCompressed

Determines whether a file can be loaded as CompressedImageData.

compressed = love.image.isCompressed( filename )

compressedbooleanWhether the file can be loaded as CompressedImageData or not.
filenamestringThe filename of the potentially compressed image file.

compressed = love.image.isCompressed( fileData )

compressedbooleanWhether the FileData can be loaded as CompressedImageData or not.
fileDataFileDataA FileData potentially containing a compressed image.

love.image.newCompressedData

Create a new CompressedImageData object from a compressed image file. LÖVE supports several compressed texture formats, enumerated in the CompressedImageFormat page.

compressedImageData = love.image.newCompressedData( filename )

compressedImageDataCompressedImageDataThe new CompressedImageData object.
filenamestringThe filename of the compressed image file.

compressedImageData = love.image.newCompressedData( fileData )

compressedImageDataCompressedImageDataThe new CompressedImageData object.
fileDataFileDataA FileData containing a compressed image.

love.image.newImageData

Creates a new ImageData object.

imageData = love.image.newImageData( width, height )

imageDataImageDataThe new blank ImageData object. Each pixel's color values, (including the alpha values!) will be set to zero.
widthnumberThe width of the ImageData.
heightnumberThe height of the ImageData.

imageData = love.image.newImageData( width, height, format, data )

imageDataImageDataThe new ImageData object.
widthnumberThe width of the ImageData.
heightnumberThe height of the ImageData.
format ('rgba8')PixelFormatThe pixel format of the ImageData.
data (nil)stringOptional raw byte data to load into the ImageData, in the format specified by ''format''.

imageData = love.image.newImageData( width, height, data )

imageDataImageDataThe new ImageData object.
widthnumberThe width of the ImageData.
heightnumberThe height of the ImageData.
datastringThe data to load into the ImageData (RGBA bytes, left to right and top to bottom).

imageData = love.image.newImageData( filename )

imageDataImageDataThe new ImageData object.
filenamestringThe filename of the image file.

imageData = love.image.newImageData( filedata )

imageDataImageDataThe new ImageData object.
filedataFileDataThe encoded file data to decode into image data.

CompressedImageData:getDimensions

Gets the width and height of the CompressedImageData.

width, height = CompressedImageData:getDimensions()

widthnumberThe width of the CompressedImageData.
heightnumberThe height of the CompressedImageData.

width, height = CompressedImageData:getDimensions( level )

widthnumberThe width of a specific mipmap level of the CompressedImageData.
heightnumberThe height of a specific mipmap level of the CompressedImageData.
levelnumberA mipmap level. Must be in the range of CompressedImageData:getMipmapCount().

CompressedImageData:getFormat

Gets the format of the CompressedImageData.

format = CompressedImageData:getFormat()

formatCompressedImageFormatThe format of the CompressedImageData.

CompressedImageData:getHeight

Gets the height of the CompressedImageData.

height = CompressedImageData:getHeight()

heightnumberThe height of the CompressedImageData.

height = CompressedImageData:getHeight( level )

heightnumberThe height of a specific mipmap level of the CompressedImageData.
levelnumberA mipmap level. Must be in the range of CompressedImageData:getMipmapCount().

CompressedImageData:getMipmapCount

Gets the number of mipmap levels in the CompressedImageData. The base mipmap level (original image) is included in the count.

mipmaps = CompressedImageData:getMipmapCount()

mipmapsnumberThe number of mipmap levels stored in the CompressedImageData.

CompressedImageData:getWidth

Gets the width of the CompressedImageData.

width = CompressedImageData:getWidth()

widthnumberThe width of the CompressedImageData.

width = CompressedImageData:getWidth( level )

widthnumberThe width of a specific mipmap level of the CompressedImageData.
levelnumberA mipmap level. Must be in the range of CompressedImageData:getMipmapCount().

ImageData:encode

Encodes the ImageData and optionally writes it to the save directory.

filedata = ImageData:encode( format, filename )

filedataFileDataThe encoded image as a new FileData object.
formatImageFormatThe format to encode the image as.
filename (nil)stringThe filename to write the file to. If nil, no file will be written but the FileData will still be returned.

ImageData:encode( outFile )

outFilestringName of a file to write encoded data to. The format will be automatically deduced from the file extension.

ImageData:encode( outFile, format )

outFilestringName of a file to write encoded data to.
formatImageFormatThe format to encode the image in.

ImageData:getDimensions

Gets the width and height of the ImageData in pixels.

width, height = ImageData:getDimensions()

widthnumberThe width of the ImageData in pixels.
heightnumberThe height of the ImageData in pixels.

ImageData:getHeight

Gets the height of the ImageData in pixels.

height = ImageData:getHeight()

heightnumberThe height of the ImageData in pixels.

ImageData:getPixel

Gets the color of a pixel at a specific position in the image.

Valid x and y values start at 0 and go up to image width and height minus 1. Non-integer values are floored.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

r, g, b, a = ImageData:getPixel( x, y )

rnumberThe red component (0-1).
gnumberThe green component (0-1).
bnumberThe blue component (0-1).
anumberThe alpha component (0-1).
xnumberThe position of the pixel on the x-axis.
ynumberThe position of the pixel on the y-axis.

ImageData:getWidth

Gets the width of the ImageData in pixels.

width = ImageData:getWidth()

widthnumberThe width of the ImageData in pixels.

ImageData:mapPixel

Transform an image by applying a function to every pixel.

This function is a higher-order function. It takes another function as a parameter, and calls it once for each pixel in the ImageData.

The passed function is called with six parameters for each pixel in turn. The parameters are numbers that represent the x and y coordinates of the pixel and its red, green, blue and alpha values. The function should return the new red, green, blue, and alpha values for that pixel.

function pixelFunction(x, y, r, g, b, a)

-- template for defining your own pixel mapping function

-- perform computations giving the new values for r, g, b and a

-- ...

return r, g, b, a

end

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

ImageData:mapPixel( pixelFunction, x, y, width, height )

pixelFunctionfunctionFunction to apply to every pixel.
x (0)numberThe x-axis of the top-left corner of the area within the ImageData to apply the function to.
y (0)numberThe y-axis of the top-left corner of the area within the ImageData to apply the function to.
width (ImageData:getWidth())numberThe width of the area within the ImageData to apply the function to.
height (ImageData:getHeight())numberThe height of the area within the ImageData to apply the function to.

ImageData:paste

Paste into ImageData from another source ImageData.

ImageData:paste( source, dx, dy, sx, sy, sw, sh )

sourceImageDataSource ImageData from which to copy.
dxnumberDestination top-left position on x-axis.
dynumberDestination top-left position on y-axis.
sxnumberSource top-left position on x-axis.
synumberSource top-left position on y-axis.
swnumberSource width.
shnumberSource height.

ImageData:setPixel

Sets the color of a pixel at a specific position in the image.

Valid x and y values start at 0 and go up to image width and height minus 1.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

ImageData:setPixel( x, y, r, g, b, a )

xnumberThe position of the pixel on the x-axis.
ynumberThe position of the pixel on the y-axis.
rnumberThe red component (0-1).
gnumberThe green component (0-1).
bnumberThe blue component (0-1).
anumberThe alpha component (0-1).

CompressedImageFormat

DXT1

The DXT1 format. RGB data at 4 bits per pixel (compared to 32 bits for ImageData and regular Images.) Suitable for fully opaque images on desktop systems.

DXT3

The DXT3 format. RGBA data at 8 bits per pixel. Smooth variations in opacity do not mix well with this format.

DXT5

The DXT5 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on desktop systems.

BC4

The BC4 format (also known as 3Dc+ or ATI1.) Stores just the red channel, at 4 bits per pixel.

BC4s

The signed variant of the BC4 format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders.

BC5

The BC5 format (also known as 3Dc or ATI2.) Stores red and green channels at 8 bits per pixel.

BC5s

The signed variant of the BC5 format.

BC6h

The BC6H format. Stores half-precision floating-point RGB data in the range of 65504 at 8 bits per pixel. Suitable for HDR images on desktop systems.

BC6hs

The signed variant of the BC6H format. Stores RGB data in the range of +65504.

BC7

The BC7 format (also known as BPTC.) Stores RGB or RGBA data at 8 bits per pixel.

ETC1

The ETC1 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on older Android devices.

ETC2rgb

The RGB variant of the ETC2 format. RGB data at 4 bits per pixel. Suitable for fully opaque images on newer mobile devices.

ETC2rgba

The RGBA variant of the ETC2 format. RGBA data at 8 bits per pixel. Recommended for images with varying opacity on newer mobile devices.

ETC2rgba1

The RGBA variant of the ETC2 format where pixels are either fully transparent or fully opaque. RGBA data at 4 bits per pixel.

EACr

The single-channel variant of the EAC format. Stores just the red channel, at 4 bits per pixel.

EACrs

The signed single-channel variant of the EAC format. Same as above but pixel values in the texture are in the range of 1 instead of 1 in shaders.

EACrg

The two-channel variant of the EAC format. Stores red and green channels at 8 bits per pixel.

EACrgs

The signed two-channel variant of the EAC format.

PVR1rgb2

The 2 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 2 bits per pixel. Textures compressed with PVRTC1 formats must be square and power-of-two sized.

PVR1rgb4

The 4 bit per pixel RGB variant of the PVRTC1 format. Stores RGB data at 4 bits per pixel.

PVR1rgba2

The 2 bit per pixel RGBA variant of the PVRTC1 format.

PVR1rgba4

The 4 bit per pixel RGBA variant of the PVRTC1 format.

ASTC4x4

The 4x4 pixels per block variant of the ASTC format. RGBA data at 8 bits per pixel.

ASTC5x4

The 5x4 pixels per block variant of the ASTC format. RGBA data at 6.4 bits per pixel.

ASTC5x5

The 5x5 pixels per block variant of the ASTC format. RGBA data at 5.12 bits per pixel.

ASTC6x5

The 6x5 pixels per block variant of the ASTC format. RGBA data at 4.27 bits per pixel.

ASTC6x6

The 6x6 pixels per block variant of the ASTC format. RGBA data at 3.56 bits per pixel.

ASTC8x5

The 8x5 pixels per block variant of the ASTC format. RGBA data at 3.2 bits per pixel.

ASTC8x6

The 8x6 pixels per block variant of the ASTC format. RGBA data at 2.67 bits per pixel.

ASTC8x8

The 8x8 pixels per block variant of the ASTC format. RGBA data at 2 bits per pixel.

ASTC10x5

The 10x5 pixels per block variant of the ASTC format. RGBA data at 2.56 bits per pixel.

ASTC10x6

The 10x6 pixels per block variant of the ASTC format. RGBA data at 2.13 bits per pixel.

ASTC10x8

The 10x8 pixels per block variant of the ASTC format. RGBA data at 1.6 bits per pixel.

ASTC10x10

The 10x10 pixels per block variant of the ASTC format. RGBA data at 1.28 bits per pixel.

ASTC12x10

The 12x10 pixels per block variant of the ASTC format. RGBA data at 1.07 bits per pixel.

ASTC12x12

The 12x12 pixels per block variant of the ASTC format. RGBA data at 0.89 bits per pixel.

ImageFormat

tga

Targa image format.

png

PNG image format.

jpg

JPG image format.

bmp

BMP image format.

love.joystick

love.joystick.getJoystickCount

Gets the number of connected joysticks.

joystickcount = love.joystick.getJoystickCount()

joystickcountnumberThe number of connected joysticks.

love.joystick.getJoysticks

Gets a list of connected Joysticks.

joysticks = love.joystick.getJoysticks()

joystickstableThe list of currently connected Joysticks.

love.joystick.loadGamepadMappings

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.

love.joystick.loadGamepadMappings( filename )

filenamestringThe filename to load the mappings string from.

love.joystick.loadGamepadMappings( mappings )

mappingsstringThe mappings string to load.

love.joystick.saveGamepadMappings

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.

mappings = love.joystick.saveGamepadMappings( filename )

mappingsstringThe mappings string that was written to the file.
filenamestringThe filename to save the mappings string to.

mappings = love.joystick.saveGamepadMappings()

mappingsstringThe mappings string.

love.joystick.setGamepadMapping

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.

success = love.joystick.setGamepadMapping( guid, button, inputtype, inputindex, hatdir )

successbooleanWhether the virtual gamepad button was successfully bound.
guidstringThe OS-dependent GUID for the type of Joystick the binding will affect.
buttonGamepadButtonThe virtual gamepad button to bind.
inputtypeJoystickInputTypeThe type of input to bind the virtual gamepad button to.
inputindexnumberThe index of the axis, button, or hat to bind the virtual gamepad button to.
hatdir (nil)JoystickHatThe direction of the hat, if the virtual gamepad button will be bound to a hat. nil otherwise.

success = love.joystick.setGamepadMapping( guid, axis, inputtype, inputindex, hatdir )

successbooleanWhether the virtual gamepad axis was successfully bound.
guidstringThe OS-dependent GUID for the type of Joystick the binding will affect.
axisGamepadAxisThe virtual gamepad axis to bind.
inputtypeJoystickInputTypeThe type of input to bind the virtual gamepad axis to.
inputindexnumberThe index of the axis, button, or hat to bind the virtual gamepad axis to.
hatdir (nil)JoystickHatThe direction of the hat, if the virtual gamepad axis will be bound to a hat. nil otherwise.

Joystick:getAxes

Gets the direction of each axis.

axisDir1, axisDir2, axisDirN = Joystick:getAxes()

axisDir1numberDirection of axis1.
axisDir2numberDirection of axis2.
axisDirNnumberDirection of axisN.

Joystick:getAxis

Gets the direction of an axis.

direction = Joystick:getAxis( axis )

directionnumberCurrent value of the axis.
axisnumberThe index of the axis to be checked.

Joystick:getAxisCount

Gets the number of axes on the joystick.

axes = Joystick:getAxisCount()

axesnumberThe number of axes available.

Joystick:getButtonCount

Gets the number of buttons on the joystick.

buttons = Joystick:getButtonCount()

buttonsnumberThe number of buttons available.

Joystick:getGUID

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.

guid = Joystick:getGUID()

guidstringThe Joystick type's OS-dependent unique identifier.

Joystick:getGamepadAxis

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.

direction = Joystick:getGamepadAxis( axis )

directionnumberCurrent value of the axis.
axisGamepadAxisThe virtual axis to be checked.

Joystick:getGamepadMapping

Gets the button, axis or hat that a virtual gamepad input is bound to.

inputtype, inputindex, hatdirection = Joystick:getGamepadMapping( axis )

inputtypeJoystickInputTypeThe type of input the virtual gamepad axis is bound to.
inputindexnumberThe index of the Joystick's button, axis or hat that the virtual gamepad axis is bound to.
hatdirectionJoystickHatThe direction of the hat, if the virtual gamepad axis is bound to a hat. nil otherwise.
axisGamepadAxisThe virtual gamepad axis to get the binding for.

inputtype, inputindex, hatdirection = Joystick:getGamepadMapping( button )

inputtypeJoystickInputTypeThe type of input the virtual gamepad button is bound to.
inputindexnumberThe index of the Joystick's button, axis or hat that the virtual gamepad button is bound to.
hatdirectionJoystickHatThe direction of the hat, if the virtual gamepad button is bound to a hat. nil otherwise.
buttonGamepadButtonThe virtual gamepad button to get the binding for.

Joystick:getHat

Gets the direction of the Joystick's hat.

direction = Joystick:getHat( hat )

directionJoystickHatThe direction the hat is pushed.
hatnumberThe index of the hat to be checked.

Joystick:getHatCount

Gets the number of hats on the joystick.

hats = Joystick:getHatCount()

hatsnumberHow many hats the joystick has.

Joystick:getID

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.

id, instanceid = Joystick:getID()

idnumberThe Joystick's unique identifier. Remains the same as long as the game is running.
instanceidnumberUnique instance identifier. Changes every time the Joystick is reconnected. nil if the Joystick is not connected.

Joystick:getName

Gets the name of the joystick.

name = Joystick:getName()

namestringThe name of the joystick.

Joystick:getVibration

Gets the current vibration motor strengths on a Joystick with rumble support.

left, right = Joystick:getVibration()

leftnumberCurrent strength of the left vibration motor on the Joystick.
rightnumberCurrent strength of the right vibration motor on the Joystick.

Joystick:isConnected

Gets whether the Joystick is connected.

connected = Joystick:isConnected()

connectedbooleanTrue if the Joystick is currently connected, false otherwise.

Joystick:isDown

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.

anyDown = Joystick:isDown( buttonN )

anyDownbooleanTrue if any supplied button is down, false if not.
buttonNnumberThe index of a button to check.

Joystick:isGamepad

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.

isgamepad = Joystick:isGamepad()

isgamepadbooleanTrue if the Joystick is recognized as a gamepad, false otherwise.

Joystick:isGamepadDown

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.

anyDown = Joystick:isGamepadDown( buttonN )

anyDownbooleanTrue if any supplied button is down, false if not.
buttonNGamepadButtonThe gamepad button to check.

Joystick:isVibrationSupported

Gets whether the Joystick supports vibration.

supported = Joystick:isVibrationSupported()

supportedbooleanTrue if rumble / force feedback vibration is supported on this Joystick, false if not.

Joystick:setVibration

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.

success = Joystick:setVibration( left, right )

successbooleanTrue if the vibration was successfully applied, false if not.
leftnumberStrength of the left vibration motor on the Joystick. Must be in the range of 1.
rightnumberStrength of the right vibration motor on the Joystick. Must be in the range of 1.

success = Joystick:setVibration()

successbooleanTrue if the vibration was successfully disabled, false if not.

success = Joystick:setVibration( left, right, duration )

successbooleanTrue if the vibration was successfully applied, false if not.
leftnumberStrength of the left vibration motor on the Joystick. Must be in the range of 1.
rightnumberStrength of the right vibration motor on the Joystick. Must be in the range of 1.
duration (-1)numberThe duration of the vibration in seconds. A negative value means infinite duration.

GamepadAxis

leftx

The x-axis of the left thumbstick.

lefty

The y-axis of the left thumbstick.

rightx

The x-axis of the right thumbstick.

righty

The y-axis of the right thumbstick.

triggerleft

Left analog trigger.

triggerright

Right analog trigger.

GamepadButton

a

Bottom face button (A).

b

Right face button (B).

x

Left face button (X).

y

Top face button (Y).

back

Back button.

guide

Guide button.

start

Start button.

leftstick

Left stick click button.

rightstick

Right stick click button.

leftshoulder

Left bumper.

rightshoulder

Right bumper.

dpup

D-pad up.

dpdown

D-pad down.

dpleft

D-pad left.

dpright

D-pad right.

JoystickHat

c

Centered

d

Down

l

Left

ld

Left+Down

lu

Left+Up

r

Right

rd

Right+Down

ru

Right+Up

u

Up

JoystickInputType

axis

Analog axis.

button

Button.

hat

8-direction hat value.

love.keyboard

love.keyboard.getKeyFromScancode

Gets the key corresponding to the given hardware scancode.

Unlike key constants, Scancodes are keyboard layout-independent. For example the scancode 'w' will be generated if the key in the same place as the 'w' key on an American keyboard is pressed, no matter what the key is labelled or what the user's operating system settings are.

Scancodes are useful for creating default controls that have the same physical locations on on all systems.

key = love.keyboard.getKeyFromScancode( scancode )

keyKeyConstantThe key corresponding to the given scancode, or 'unknown' if the scancode doesn't map to a KeyConstant on the current system.
scancodeScancodeThe scancode to get the key from.

love.keyboard.getScancodeFromKey

Gets the hardware scancode corresponding to the given key.

Unlike key constants, Scancodes are keyboard layout-independent. For example the scancode 'w' will be generated if the key in the same place as the 'w' key on an American keyboard is pressed, no matter what the key is labelled or what the user's operating system settings are.

Scancodes are useful for creating default controls that have the same physical locations on on all systems.

scancode = love.keyboard.getScancodeFromKey( key )

scancodeScancodeThe scancode corresponding to the given key, or 'unknown' if the given key has no known physical representation on the current system.
keyKeyConstantThe key to get the scancode from.

love.keyboard.hasKeyRepeat

Gets whether key repeat is enabled.

enabled = love.keyboard.hasKeyRepeat()

enabledbooleanWhether key repeat is enabled.

love.keyboard.hasTextInput

Gets whether text input events are enabled.

enabled = love.keyboard.hasTextInput()

enabledbooleanWhether text input events are enabled.

love.keyboard.isDown

Checks whether a certain key is down. Not to be confused with love.keypressed or love.keyreleased.

down = love.keyboard.isDown( key )

downbooleanTrue if the key is down, false if not.
keyKeyConstantThe key to check.

anyDown = love.keyboard.isDown( key, ... )

anyDownbooleanTrue if any supplied key is down, false if not.
keyKeyConstantA key to check.
...KeyConstantAdditional keys to check.

love.keyboard.isScancodeDown

Checks whether the specified Scancodes are pressed. Not to be confused with love.keypressed or love.keyreleased.

Unlike regular KeyConstants, Scancodes are keyboard layout-independent. The scancode 'w' is used if the key in the same place as the 'w' key on an American keyboard is pressed, no matter what the key is labelled or what the user's operating system settings are.

down = love.keyboard.isScancodeDown( scancode, ... )

downbooleanTrue if any supplied Scancode is down, false if not.
scancodeScancodeA Scancode to check.
...ScancodeAdditional Scancodes to check.

love.keyboard.setKeyRepeat

Enables or disables key repeat for love.keypressed. It is disabled by default.

love.keyboard.setKeyRepeat( enable )

enablebooleanWhether repeat keypress events should be enabled when a key is held down.

love.keyboard.setTextInput

Enables or disables text input events. It is enabled by default on Windows, Mac, and Linux, and disabled by default on iOS and Android.

On touch devices, this shows the system's native on-screen keyboard when it's enabled.

love.keyboard.setTextInput( enable )

enablebooleanWhether text input events should be enabled.

love.keyboard.setTextInput( enable, x, y, w, h )

enablebooleanWhether text input events should be enabled.
xnumberText rectangle x position.
ynumberText rectangle y position.
wnumberText rectangle width.
hnumberText rectangle height.

Scancode

a

The 'A' key on an American layout.

b

The 'B' key on an American layout.

c

The 'C' key on an American layout.

d

The 'D' key on an American layout.

e

The 'E' key on an American layout.

f

The 'F' key on an American layout.

g

The 'G' key on an American layout.

h

The 'H' key on an American layout.

i

The 'I' key on an American layout.

j

The 'J' key on an American layout.

k

The 'K' key on an American layout.

l

The 'L' key on an American layout.

m

The 'M' key on an American layout.

n

The 'N' key on an American layout.

o

The 'O' key on an American layout.

p

The 'P' key on an American layout.

q

The 'Q' key on an American layout.

r

The 'R' key on an American layout.

s

The 'S' key on an American layout.

t

The 'T' key on an American layout.

u

The 'U' key on an American layout.

v

The 'V' key on an American layout.

w

The 'W' key on an American layout.

x

The 'X' key on an American layout.

y

The 'Y' key on an American layout.

z

The 'Z' key on an American layout.

1

The '1' key on an American layout.

2

The '2' key on an American layout.

3

The '3' key on an American layout.

4

The '4' key on an American layout.

5

The '5' key on an American layout.

6

The '6' key on an American layout.

7

The '7' key on an American layout.

8

The '8' key on an American layout.

9

The '9' key on an American layout.

0

The '0' key on an American layout.

return

The 'return' / 'enter' key on an American layout.

escape

The 'escape' key on an American layout.

backspace

The 'backspace' key on an American layout.

tab

The 'tab' key on an American layout.

space

The spacebar on an American layout.

-

The minus key on an American layout.

=

The equals key on an American layout.

[

The left-bracket key on an American layout.

]

The right-bracket key on an American layout.

\

The backslash key on an American layout.

nonus#

The non-U.S. hash scancode.

;

The semicolon key on an American layout.

'

The apostrophe key on an American layout.

`

The back-tick / grave key on an American layout.

,

The comma key on an American layout.

.

The period key on an American layout.

/

The forward-slash key on an American layout.

capslock

The capslock key on an American layout.

f1

The F1 key on an American layout.

f2

The F2 key on an American layout.

f3

The F3 key on an American layout.

f4

The F4 key on an American layout.

f5

The F5 key on an American layout.

f6

The F6 key on an American layout.

f7

The F7 key on an American layout.

f8

The F8 key on an American layout.

f9

The F9 key on an American layout.

f10

The F10 key on an American layout.

f11

The F11 key on an American layout.

f12

The F12 key on an American layout.

f13

The F13 key on an American layout.

f14

The F14 key on an American layout.

f15

The F15 key on an American layout.

f16

The F16 key on an American layout.

f17

The F17 key on an American layout.

f18

The F18 key on an American layout.

f19

The F19 key on an American layout.

f20

The F20 key on an American layout.

f21

The F21 key on an American layout.

f22

The F22 key on an American layout.

f23

The F23 key on an American layout.

f24

The F24 key on an American layout.

lctrl

The left control key on an American layout.

lshift

The left shift key on an American layout.

lalt

The left alt / option key on an American layout.

lgui

The left GUI (command / windows / super) key on an American layout.

rctrl

The right control key on an American layout.

rshift

The right shift key on an American layout.

ralt

The right alt / option key on an American layout.

rgui

The right GUI (command / windows / super) key on an American layout.

printscreen

The printscreen key on an American layout.

scrolllock

The scroll-lock key on an American layout.

pause

The pause key on an American layout.

insert

The insert key on an American layout.

home

The home key on an American layout.

numlock

The numlock / clear key on an American layout.

pageup

The page-up key on an American layout.

delete

The forward-delete key on an American layout.

end

The end key on an American layout.

pagedown

The page-down key on an American layout.

right

The right-arrow key on an American layout.

left

The left-arrow key on an American layout.

down

The down-arrow key on an American layout.

up

The up-arrow key on an American layout.

nonusbackslash

The non-U.S. backslash scancode.

application

The application key on an American layout. Windows contextual menu, compose key.

execute

The 'execute' key on an American layout.

help

The 'help' key on an American layout.

menu

The 'menu' key on an American layout.

select

The 'select' key on an American layout.

stop

The 'stop' key on an American layout.

again

The 'again' key on an American layout.

undo

The 'undo' key on an American layout.

cut

The 'cut' key on an American layout.

copy

The 'copy' key on an American layout.

paste

The 'paste' key on an American layout.

find

The 'find' key on an American layout.

kp/

The keypad forward-slash key on an American layout.

kp*

The keypad '*' key on an American layout.

kp-

The keypad minus key on an American layout.

kp+

The keypad plus key on an American layout.

kp=

The keypad equals key on an American layout.

kpenter

The keypad enter key on an American layout.

kp1

The keypad '1' key on an American layout.

kp2

The keypad '2' key on an American layout.

kp3

The keypad '3' key on an American layout.

kp4

The keypad '4' key on an American layout.

kp5

The keypad '5' key on an American layout.

kp6

The keypad '6' key on an American layout.

kp7

The keypad '7' key on an American layout.

kp8

The keypad '8' key on an American layout.

kp9

The keypad '9' key on an American layout.

kp0

The keypad '0' key on an American layout.

kp.

The keypad period key on an American layout.

international1

The 1st international key on an American layout. Used on Asian keyboards.

international2

The 2nd international key on an American layout.

international3

The 3rd international key on an American layout. Yen.

international4

The 4th international key on an American layout.

international5

The 5th international key on an American layout.

international6

The 6th international key on an American layout.

international7

The 7th international key on an American layout.

international8

The 8th international key on an American layout.

international9

The 9th international key on an American layout.

lang1

Hangul/English toggle scancode.

lang2

Hanja conversion scancode.

lang3

Katakana scancode.

lang4

Hiragana scancode.

lang5

Zenkaku/Hankaku scancode.

mute

The mute key on an American layout.

volumeup

The volume up key on an American layout.

volumedown

The volume down key on an American layout.

audionext

The audio next track key on an American layout.

audioprev

The audio previous track key on an American layout.

audiostop

The audio stop key on an American layout.

audioplay

The audio play key on an American layout.

audiomute

The audio mute key on an American layout.

mediaselect

The media select key on an American layout.

www

The 'WWW' key on an American layout.

mail

The Mail key on an American layout.

calculator

The calculator key on an American layout.

computer

The 'computer' key on an American layout.

acsearch

The AC Search key on an American layout.

achome

The AC Home key on an American layout.

acback

The AC Back key on an American layout.

acforward

The AC Forward key on an American layout.

acstop

Th AC Stop key on an American layout.

acrefresh

The AC Refresh key on an American layout.

acbookmarks

The AC Bookmarks key on an American layout.

power

The system power scancode.

brightnessdown

The brightness-down scancode.

brightnessup

The brightness-up scancode.

displayswitch

The display switch scancode.

kbdillumtoggle

The keyboard illumination toggle scancode.

kbdillumdown

The keyboard illumination down scancode.

kbdillumup

The keyboard illumination up scancode.

eject

The eject scancode.

sleep

The system sleep scancode.

alterase

The alt-erase key on an American layout.

sysreq

The sysreq key on an American layout.

cancel

The 'cancel' key on an American layout.

clear

The 'clear' key on an American layout.

prior

The 'prior' key on an American layout.

return2

The 'return2' key on an American layout.

separator

The 'separator' key on an American layout.

out

The 'out' key on an American layout.

oper

The 'oper' key on an American layout.

clearagain

The 'clearagain' key on an American layout.

crsel

The 'crsel' key on an American layout.

exsel

The 'exsel' key on an American layout.

kp00

The keypad 00 key on an American layout.

kp000

The keypad 000 key on an American layout.

thsousandsseparator

The thousands-separator key on an American layout.

decimalseparator

The decimal separator key on an American layout.

currencyunit

The currency unit key on an American layout.

currencysubunit

The currency sub-unit key on an American layout.

app1

The 'app1' scancode.

app2

The 'app2' scancode.

unknown

An unknown key.

love.math

love.math.compress

Compresses a string or data using a specific compression algorithm.

compressedData = love.math.compress( rawstring, format, level )

compressedDataCompressedDataA new Data object containing the compressed version of the string.
rawstringstringThe raw (un-compressed) string to compress.
format ('lz4')CompressedDataFormatThe format to use when compressing the string.
level (-1)numberThe 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.

compressedData = love.math.compress( data, format, level )

compressedDataCompressedDataA new Data object containing the compressed version of the raw data.
dataDataA Data object containing the raw (un-compressed) data to compress.
format ('lz4')CompressedDataFormatThe format to use when compressing the data.
level (-1)numberThe 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.

love.math.decompress

Decompresses a CompressedData or previously compressed string or Data object.

rawstring = love.math.decompress( compressedData )

rawstringstringA string containing the raw decompressed data.
compressedDataCompressedDataThe compressed data to decompress.

rawstring = love.math.decompress( compressedstring, format )

rawstringstringA string containing the raw decompressed data.
compressedstringstringA string containing data previously compressed with love.math.compress.
formatCompressedDataFormatThe format that was used to compress the given string.

rawstring = love.math.decompress( data, format )

rawstringstringA string containing the raw decompressed data.
dataDataA Data object containing data previously compressed with love.math.compress.
formatCompressedDataFormatThe format that was used to compress the given data.

love.math.gammaToLinear

Converts a color from gamma-space (sRGB) to linear-space (RGB). This is useful when doing gamma-correct rendering and you need to do math in linear RGB in the few cases where LÖVE doesn't handle conversions automatically.

Read more about gamma-correct rendering here, here, and here.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

lr, lg, lb = love.math.gammaToLinear( r, g, b )

lrnumberThe red channel of the converted color in linear RGB space.
lgnumberThe green channel of the converted color in linear RGB space.
lbnumberThe blue channel of the converted color in linear RGB space.
rnumberThe red channel of the sRGB color to convert.
gnumberThe green channel of the sRGB color to convert.
bnumberThe blue channel of the sRGB color to convert.

lr, lg, lb = love.math.gammaToLinear( color )

lrnumberThe red channel of the converted color in linear RGB space.
lgnumberThe green channel of the converted color in linear RGB space.
lbnumberThe blue channel of the converted color in linear RGB space.
colortableAn array with the red, green, and blue channels of the sRGB color to convert.

lc = love.math.gammaToLinear( c )

lcnumberThe value of the color channel in linear RGB space.
cnumberThe value of a color channel in sRGB space to convert.

love.math.getRandomSeed

Gets the seed of the random number generator.

The seed is split into two numbers due to Lua's use of doubles for all number values - doubles can't accurately represent integer values above 2^53, but the seed can be an integer value up to 2^64.

low, high = love.math.getRandomSeed()

lownumberInteger number representing the lower 32 bits of the random number generator's 64 bit seed value.
highnumberInteger number representing the higher 32 bits of the random number generator's 64 bit seed value.

love.math.getRandomState

Gets the current state of the random number generator. This returns an opaque implementation-dependent string which is only useful for later use with love.math.setRandomState or RandomGenerator:setState.

This is different from love.math.getRandomSeed in that getRandomState gets the random number generator's current state, whereas getRandomSeed gets the previously set seed number.

state = love.math.getRandomState()

statestringThe current state of the random number generator, represented as a string.

love.math.isConvex

Checks whether a polygon is convex.

PolygonShapes in love.physics, some forms of Meshes, and polygons drawn with love.graphics.polygon must be simple convex polygons.

convex = love.math.isConvex( vertices )

convexbooleanWhether the given polygon is convex.
verticestableThe vertices of the polygon as a table in the form of {x1, y1, x2, y2, x3, y3, ...}.

convex = love.math.isConvex( x1, y1, x2, y2, x3, y3 )

convexbooleanWhether the given polygon is convex.
x1numberThe position of the first vertex of the polygon on the x-axis.
y1numberThe position of the first vertex of the polygon on the y-axis.
x2numberThe position of the second vertex of the polygon on the x-axis.
y2numberThe position of the second vertex of the polygon on the y-axis.
x3numberThe position of the third vertex of the polygon on the x-axis.
y3numberThe position of the third vertex of the polygon on the y-axis.

love.math.linearToGamma

Converts a color from linear-space (RGB) to gamma-space (sRGB). This is useful when storing linear RGB color values in an image, because the linear RGB color space has less precision than sRGB for dark colors, which can result in noticeable color banding when drawing.

In general, colors chosen based on what they look like on-screen are already in gamma-space and should not be double-converted. Colors calculated using math are often in the linear RGB space.

Read more about gamma-correct rendering here, here, and here.

In versions prior to 11.0, color component values were within the range of 0 to 255 instead of 0 to 1.

cr, cg, cb = love.math.linearToGamma( lr, lg, lb )

crnumberThe red channel of the converted color in gamma sRGB space.
cgnumberThe green channel of the converted color in gamma sRGB space.
cbnumberThe blue channel of the converted color in gamma sRGB space.
lrnumberThe red channel of the linear RGB color to convert.
lgnumberThe green channel of the linear RGB color to convert.
lbnumberThe blue channel of the linear RGB color to convert.

cr, cg, cb = love.math.linearToGamma( color )

crnumberThe red channel of the converted color in gamma sRGB space.
cgnumberThe green channel of the converted color in gamma sRGB space.
cbnumberThe blue channel of the converted color in gamma sRGB space.
colortableAn array with the red, green, and blue channels of the linear RGB color to convert.

c = love.math.linearToGamma( lc )

cnumberThe value of the color channel in gamma sRGB space.
lcnumberThe value of a color channel in linear RGB space to convert.

love.math.newBezierCurve

Creates a new BezierCurve object.

The number of vertices in the control polygon determines the degree of the curve, e.g. three vertices define a quadratic (degree 2) Bézier curve, four vertices define a cubic (degree 3) Bézier curve, etc.

curve = love.math.newBezierCurve( vertices )

curveBezierCurveA Bézier curve object.
verticestableThe vertices of the control polygon as a table in the form of {x1, y1, x2, y2, x3, y3, ...}.

curve = love.math.newBezierCurve( x1, y1, x2, y2, x3, y3 )

curveBezierCurveA Bézier curve object.
x1numberThe position of the first vertex of the control polygon on the x-axis.
y1numberThe position of the first vertex of the control polygon on the y-axis.
x2numberThe position of the second vertex of the control polygon on the x-axis.
y2numberThe position of the second vertex of the control polygon on the y-axis.
x3numberThe position of the third vertex of the control polygon on the x-axis.
y3numberThe position of the third vertex of the control polygon on the y-axis.

love.math.newRandomGenerator

Creates a new RandomGenerator object which is completely independent of other RandomGenerator objects and random functions.

rng = love.math.newRandomGenerator()

rngRandomGeneratorThe new Random Number Generator object.

rng = love.math.newRandomGenerator( seed )

rngRandomGeneratorThe new Random Number Generator object.
seednumberThe initial seed number to use for this object.

rng = love.math.newRandomGenerator( low, high )

rngRandomGeneratorThe new Random Number Generator object.
lownumberThe lower 32 bits of the seed number to use for this object.
highnumberThe higher 32 bits of the seed number to use for this object.

love.math.newTransform

Creates a new Transform object.

transform = love.math.newTransform()

transformTransformThe new Transform object.

transform = love.math.newTransform( x, y, angle, sx, sy, ox, oy, kx, ky )

transformTransformThe new Transform object.
xnumberThe position of the new Transform on the x-axis.
ynumberThe position of the new Transform on the y-axis.
angle (0)numberThe orientation of the new Transform in radians.
sx (1)numberScale factor on the x-axis.
sy (sx)numberScale factor on the y-axis.
ox (0)numberOrigin offset on the x-axis.
oy (0)numberOrigin offset on the y-axis.
kx (0)numberShearing / skew factor on the x-axis.
ky (0)numberShearing / skew factor on the y-axis.

love.math.noise

Generates a Simplex or Perlin noise value in 1-4 dimensions. The return value will always be the same, given the same arguments.

Simplex noise is closely related to Perlin noise. It is widely used for procedural content generation.

There are many webpages which discuss Perlin and Simplex noise in detail.

value = love.math.noise( x )

valuenumberThe noise value in the range of 1.
xnumberThe number used to generate the noise value.

value = love.math.noise( x, y )

valuenumberThe noise value in the range of 1.
xnumberThe first value of the 2-dimensional vector used to generate the noise value.
ynumberThe second value of the 2-dimensional vector used to generate the noise value.

value = love.math.noise( x, y, z )

valuenumberThe noise value in the range of 1.
xnumberThe first value of the 3-dimensional vector used to generate the noise value.
ynumberThe second value of the 3-dimensional vector used to generate the noise value.
znumberThe third value of the 3-dimensional vector used to generate the noise value.

value = love.math.noise( x, y, z, w )

valuenumberThe noise value in the range of 1.
xnumberThe first value of the 4-dimensional vector used to generate the noise value.
ynumberThe second value of the 4-dimensional vector used to generate the noise value.
znumberThe third value of the 4-dimensional vector used to generate the noise value.
wnumberThe fourth value of the 4-dimensional vector used to generate the noise value.

love.math.random

Generates a pseudo-random number in a platform independent manner. The default love.run seeds this function at startup, so you generally don't need to seed it yourself.

number = love.math.random()

numbernumberThe pseudo-random number.

number = love.math.random( max )

numbernumberThe pseudo-random integer number.
maxnumberThe maximum possible value it should return.

number = love.math.random( min, max )

numbernumberThe pseudo-random integer number.
minnumberThe minimum possible value it should return.
maxnumberThe maximum possible value it should return.

love.math.randomNormal

Get a normally distributed pseudo random number.

number = love.math.randomNormal( stddev, mean )

numbernumberNormally distributed random number with variance (stddev)² and the specified mean.
stddev (1)numberStandard deviation of the distribution.
mean (0)numberThe mean of the distribution.

love.math.setRandomSeed

Sets the seed of the random number generator using the specified integer number. This is called internally at startup, so you generally don't need to call it yourself.

love.math.setRandomSeed( seed )

seednumberThe integer number with which you want to seed the randomization. Must be within the range of 2^53 - 1.

love.math.setRandomSeed( low, high )

lownumberThe lower 32 bits of the seed value. Must be within the range of 2^32 - 1.
highnumberThe higher 32 bits of the seed value. Must be within the range of 2^32 - 1.

love.math.setRandomState

Sets the current state of the random number generator. The value used as an argument for this function is an opaque implementation-dependent string and should only originate from a previous call to love.math.getRandomState.

This is different from love.math.setRandomSeed in that setRandomState directly sets the random number generator's current implementation-dependent state, whereas setRandomSeed gives it a new seed value.

love.math.setRandomState( state )

statestringThe new state of the random number generator, represented as a string. This should originate from a previous call to love.math.getRandomState.

love.math.triangulate

Decomposes a simple convex or concave polygon into triangles.

triangles = love.math.triangulate( polygon )

trianglestableList of triangles the polygon is composed of, in the form of {{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y3}, ...}.
polygontablePolygon to triangulate. Must not intersect itself.

triangles = love.math.triangulate( x1, y1, x2, y2, x3, y3 )

trianglestableList of triangles the polygon is composed of, in the form of {{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y3}, ...}.
x1numberThe position of the first vertex of the polygon on the x-axis.
y1numberThe position of the first vertex of the polygon on the y-axis.
x2numberThe position of the second vertex of the polygon on the x-axis.
y2numberThe position of the second vertex of the polygon on the y-axis.
x3numberThe position of the third vertex of the polygon on the x-axis.
y3numberThe position of the third vertex of the polygon on the y-axis.

BezierCurve:evaluate

Evaluate Bézier curve at parameter t. The parameter must be between 0 and 1 (inclusive).

This function can be used to move objects along paths or tween parameters. However it should not be used to render the curve, see BezierCurve:render for that purpose.

x, y = BezierCurve:evaluate( t )

xnumberx coordinate of the curve at parameter t.
ynumbery coordinate of the curve at parameter t.
tnumberWhere to evaluate the curve.

BezierCurve:getControlPoint

Get coordinates of the i-th control point. Indices start with 1.

x, y = BezierCurve:getControlPoint( i )

xnumberPosition of the control point along the x axis.
ynumberPosition of the control point along the y axis.
inumberIndex of the control point.

BezierCurve:getControlPointCount

Get the number of control points in the Bézier curve.

count = BezierCurve:getControlPointCount()

countnumberThe number of control points.

BezierCurve:getDegree

Get degree of the Bézier curve. The degree is equal to number-of-control-points - 1.

degree = BezierCurve:getDegree()

degreenumberDegree of the Bézier curve.

BezierCurve:getDerivative

Get the derivative of the Bézier curve.

This function can be used to rotate sprites moving along a curve in the direction of the movement and compute the direction perpendicular to the curve at some parameter t.

derivative = BezierCurve:getDerivative()

derivativeBezierCurveThe derivative curve.

BezierCurve:getSegment

Gets a BezierCurve that corresponds to the specified segment of this BezierCurve.

curve = BezierCurve:getSegment( startpoint, endpoint )

curveBezierCurveA BezierCurve that corresponds to the specified segment.
startpointnumberThe starting point along the curve. Must be between 0 and 1.
endpointnumberThe end of the segment. Must be between 0 and 1.

BezierCurve:insertControlPoint

Insert control point as the new i-th control point. Existing control points from i onwards are pushed back by 1. Indices start with 1. Negative indices wrap around: -1 is the last control point, -2 the one before the last, etc.

BezierCurve:insertControlPoint( x, y, i )

xnumberPosition of the control point along the x axis.
ynumberPosition of the control point along the y axis.
i (-1)numberIndex of the control point.

BezierCurve:removeControlPoint

Removes the specified control point.

BezierCurve:removeControlPoint( index )

indexnumberThe index of the control point to remove.

BezierCurve:render

Get a list of coordinates to be used with love.graphics.line.

This function samples the Bézier curve using recursive subdivision. You can control the recursion depth using the depth parameter.

If you are just interested to know the position on the curve given a parameter, use BezierCurve:evaluate.

coordinates = BezierCurve:render( depth )

coordinatestableList of x,y-coordinate pairs of points on the curve.
depth (5)numberNumber of recursive subdivision steps.

BezierCurve:renderSegment

Get a list of coordinates on a specific part of the curve, to be used with love.graphics.line.

This function samples the Bézier curve using recursive subdivision. You can control the recursion depth using the depth parameter.

If you are just need to know the position on the curve given a parameter, use BezierCurve:evaluate.

coordinates = BezierCurve:renderSegment( startpoint, endpoint, depth )

coordinatestableList of x,y-coordinate pairs of points on the specified part of the curve.
startpointnumberThe starting point along the curve. Must be between 0 and 1.
endpointnumberThe end of the segment to render. Must be between 0 and 1.
depth (5)numberNumber of recursive subdivision steps.

BezierCurve:rotate

Rotate the Bézier curve by an angle.

BezierCurve:rotate( angle, ox, oy )

anglenumberRotation angle in radians.
ox (0)numberX coordinate of the rotation center.
oy (0)numberY coordinate of the rotation center.

BezierCurve:scale

Scale the Bézier curve by a factor.

BezierCurve:scale( s, ox, oy )

snumberScale factor.
ox (0)numberX coordinate of the scaling center.
oy (0)numberY coordinate of the scaling center.

BezierCurve:setControlPoint

Set coordinates of the i-th control point. Indices start with 1.

BezierCurve:setControlPoint( i, x, y )

inumberIndex of the control point.
xnumberPosition of the control point along the x axis.
ynumberPosition of the control point along the y axis.

BezierCurve:translate

Move the Bézier curve by an offset.

BezierCurve:translate( dx, dy )

dxnumberOffset along the x axis.
dynumberOffset along the y axis.

CompressedData:getFormat

Gets the compression format of the CompressedData.

format = CompressedData:getFormat()

formatCompressedDataFormatThe format of the CompressedData.

RandomGenerator:getSeed

Gets the seed of the random number generator object.

The seed is split into two numbers due to Lua's use of doubles for all number values - doubles can't accurately represent integer values above 2^53, but the seed value is an integer number in the range of 2^64 - 1.

low, high = RandomGenerator:getSeed()

lownumberInteger number representing the lower 32 bits of the RandomGenerator's 64 bit seed value.
highnumberInteger number representing the higher 32 bits of the RandomGenerator's 64 bit seed value.

RandomGenerator:getState

Gets the current state of the random number generator. This returns an opaque string which is only useful for later use with RandomGenerator:setState in the same major version of LÖVE.

This is different from RandomGenerator:getSeed in that getState gets the RandomGenerator's current state, whereas getSeed gets the previously set seed number.

state = RandomGenerator:getState()

statestringThe current state of the RandomGenerator object, represented as a string.

RandomGenerator:random

Generates a pseudo-random number in a platform independent manner.

number = RandomGenerator:random()

numbernumberThe pseudo-random number.

number = RandomGenerator:random( max )

numbernumberThe pseudo-random integer number.
maxnumberThe maximum possible value it should return.

number = RandomGenerator:random( min, max )

numbernumberThe pseudo-random integer number.
minnumberThe minimum possible value it should return.
maxnumberThe maximum possible value it should return.

RandomGenerator:randomNormal

Get a normally distributed pseudo random number.

number = RandomGenerator:randomNormal( stddev, mean )

numbernumberNormally distributed random number with variance (stddev)² and the specified mean.
stddev (1)numberStandard deviation of the distribution.
mean (0)numberThe mean of the distribution.

RandomGenerator:setSeed

Sets the seed of the random number generator using the specified integer number.

RandomGenerator:setSeed( seed )

seednumberThe integer number with which you want to seed the randomization. Must be within the range of 2^53.

RandomGenerator:setSeed( low, high )

lownumberThe lower 32 bits of the seed value. Must be within the range of 2^32 - 1.
highnumberThe higher 32 bits of the seed value. Must be within the range of 2^32 - 1.

RandomGenerator:setState

Sets the current state of the random number generator. The value used as an argument for this function is an opaque string and should only originate from a previous call to RandomGenerator:getState in the same major version of LÖVE.

This is different from RandomGenerator:setSeed in that setState directly sets the RandomGenerator's current implementation-dependent state, whereas setSeed gives it a new seed value.

RandomGenerator:setState( state )

statestringThe new state of the RandomGenerator object, represented as a string. This should originate from a previous call to RandomGenerator:getState.

Transform:apply

Applies the given other Transform object to this one.

This effectively multiplies this Transform's internal transformation matrix with the other Transform's (i.e. self * other), and stores the result in this object.

transform = Transform:apply( other )

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.
otherTransformThe other Transform object to apply to this Transform.

Transform:clone

Creates a new copy of this Transform.

clone = Transform:clone()

cloneTransformThe copy of this Transform.

Transform:getMatrix

Gets the internal 4x4 transformation matrix stored by this Transform. The matrix is returned in row-major order.

e1_1, e1_2, ..., e4_4 = Transform:getMatrix()

e1_1numberThe first column of the first row of the matrix.
e1_2numberThe second column of the first row of the matrix.
...numberAdditional matrix elements.
e4_4numberThe fourth column of the fourth row of the matrix.

Transform:inverse

Creates a new Transform containing the inverse of this Transform.

inverse = Transform:inverse()

inverseTransformA new Transform object representing the inverse of this Transform's matrix.

Transform:inverseTransformPoint

Applies the reverse of the Transform object's transformation to the given 2D position.

This effectively converts the given position from the local coordinate space of the Transform into global coordinates.

One use of this method can be to convert a screen-space mouse position into global world coordinates, if the given Transform has transformations applied that are used for a camera system in-game.

globalX, globalY = Transform:inverseTransformPoint( localX, localY )

globalXnumberThe x component of the position in global coordinates.
globalYnumberThe y component of the position in global coordinates.
localXnumberThe x component of the position with the transform applied.
localYnumberThe y component of the position with the transform applied.

Transform:isAffine

Checks whether the Transform is an affine transformation.

affine = Transform:isAffine()

affinebooleantrue if the transform object is an affine transformation, false otherwise.

Transform:reset

Resets the Transform to an identity state. All previously applied transformations are erased.

transform = Transform:reset()

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.

Transform:rotate

Applies a rotation to the Transform's coordinate system. This method does not reset any previously applied transformations.

transform = Transform:rotate( angle )

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.
anglenumberThe relative angle in radians to rotate this Transform by.

Transform:scale

Scales the Transform's coordinate system. This method does not reset any previously applied transformations.

transform = Transform:scale( sx, sy )

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.
sxnumberThe relative scale factor along the x-axis.
sy (sx)numberThe relative scale factor along the y-axis.

Transform:setMatrix

Directly sets the Transform's internal 4x4 transformation matrix.

transform = Transform:setMatrix( e1_1, e1_2, ..., e4_4 )

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.
e1_1numberThe first column of the first row of the matrix.
e1_2numberThe second column of the first row of the matrix.
...numberAdditional matrix elements.
e4_4numberThe fourth column of the fourth row of the matrix.

transform = Transform:setMatrix( layout, e1_1, e1_2, ..., e4_4 )

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.
layoutMatrixLayoutHow to interpret the matrix element arguments (row-major or column-major).
e1_1numberThe first column of the first row of the matrix.
e1_2numberThe second column of the first row or the first column of the second row of the matrix, depending on the specified layout.
...numberAdditional matrix elements.
e4_4numberThe fourth column of the fourth row of the matrix.

transform = Transform:setMatrix( layout, matrix )

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.
layoutMatrixLayoutHow to interpret the matrix element arguments (row-major or column-major).
matrixtableA flat table containing the 16 matrix elements.

transform = Transform:setMatrix( layout, matrix )

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.
layoutMatrixLayoutHow to interpret the matrix element arguments (row-major or column-major).
matrixtableA table of 4 tables, with each sub-table containing 4 matrix elements.

Transform:setTransformation

Resets the Transform to the specified transformation parameters.

transform = Transform:setTransformation( x, y, angle, sx, sy, ox, oy, kx, ky )

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.
xnumberThe position of the Transform on the x-axis.
ynumberThe position of the Transform on the y-axis.
angle (0)numberThe orientation of the Transform in radians.
sx (1)numberScale factor on the x-axis.
sy (sx)numberScale factor on the y-axis.
ox (0)numberOrigin offset on the x-axis.
oy (0)numberOrigin offset on the y-axis.
kx (0)numberShearing / skew factor on the x-axis.
ky (0)numberShearing / skew factor on the y-axis.

Transform:shear

Applies a shear factor (skew) to the Transform's coordinate system. This method does not reset any previously applied transformations.

transform = Transform:shear( kx, ky )

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.
kxnumberThe shear factor along the x-axis.
kynumberThe shear factor along the y-axis.

Transform:transformPoint

Applies the Transform object's transformation to the given 2D position.

This effectively converts the given position from global coordinates into the local coordinate space of the Transform.

localX, localY = Transform:transformPoint( globalX, globalY )

localXnumberThe x component of the position with the transform applied.
localYnumberThe y component of the position with the transform applied.
globalXnumberThe x component of the position in global coordinates.
globalYnumberThe y component of the position in global coordinates.

Transform:translate

Applies a translation to the Transform's coordinate system. This method does not reset any previously applied transformations.

transform = Transform:translate( dx, dy )

transformTransformThe Transform object the method was called on. Allows easily chaining Transform methods.
dxnumberThe relative translation along the x-axis.
dynumberThe relative translation along the y-axis.

CompressedDataFormat

lz4

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.

zlib

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.

gzip

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.

deflate

Raw DEFLATE-compressed data (no header).

love.mouse

love.mouse.getCursor

Gets the current Cursor.

cursor = love.mouse.getCursor()

cursorCursorThe current cursor, or nil if no cursor is set.

love.mouse.getPosition

Returns the current position of the mouse.

x, y = love.mouse.getPosition()

xnumberThe position of the mouse along the x-axis.
ynumberThe position of the mouse along the y-axis.

love.mouse.getRelativeMode

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.

enabled = love.mouse.getRelativeMode()

enabledbooleanTrue if relative mode is enabled, false if it's disabled.

love.mouse.getSystemCursor

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.

cursor = love.mouse.getSystemCursor( ctype )

cursorCursorThe Cursor object representing the system cursor type.
ctypeCursorTypeThe type of system cursor to get.

love.mouse.getX

Returns the current x-position of the mouse.

x = love.mouse.getX()

xnumberThe position of the mouse along the x-axis.

love.mouse.getY

Returns the current y-position of the mouse.

y = love.mouse.getY()

ynumberThe position of the mouse along the y-axis.

love.mouse.hasCursor

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.

hascursor = love.mouse.hasCursor()

hascursorbooleanWhether the system has cursor functionality.

love.mouse.isCursorSupported

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.

supported = love.mouse.isCursorSupported()

supportedbooleanWhether the system has cursor functionality.

love.mouse.isDown

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.

down = love.mouse.isDown( button, ... )

downbooleanTrue if any specified button is down.
buttonnumberThe 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.
...numberAdditional button numbers to check.

anyDown = love.mouse.isDown( buttonN )

anyDownbooleanTrue if any specified button is down, false otherwise.
buttonNMouseConstantA button to check.

love.mouse.isGrabbed

Checks if the mouse is grabbed.

grabbed = love.mouse.isGrabbed()

grabbedbooleanTrue if the cursor is grabbed, false if it is not.

love.mouse.isVisible

Checks if the cursor is visible.

visible = love.mouse.isVisible()

visiblebooleanTrue if the cursor to visible, false if the cursor is hidden.

love.mouse.newCursor

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.

cursor = love.mouse.newCursor( imageData, hotx, hoty )

cursorCursorThe new Cursor object.
imageDataImageDataThe ImageData to use for the new Cursor.
hotx (0)numberThe x-coordinate in the ImageData of the cursor's hot spot.
hoty (0)numberThe y-coordinate in the ImageData of the cursor's hot spot.

cursor = love.mouse.newCursor( filename, hotx, hoty )

cursorCursorThe new Cursor object.
filenamestringPath to the image to use for the new Cursor.
hotx (0)numberThe x-coordinate in the image of the cursor's hot spot.
hoty (0)numberThe y-coordinate in the image of the cursor's hot spot.

cursor = love.mouse.newCursor( fileData, hotx, hoty )

cursorCursorThe new Cursor object.
fileDataFileDataData representing the image to use for the new Cursor.
hotx (0)numberThe x-coordinate in the image of the cursor's hot spot.
hoty (0)numberThe y-coordinate in the image of the cursor's hot spot.

love.mouse.setCursor

Sets the current mouse cursor.

love.mouse.setCursor( cursor )

cursorCursorThe Cursor object to use as the current mouse cursor.

love.mouse.setCursor()

love.mouse.setGrabbed

Grabs the mouse and confines it to the window.

love.mouse.setGrabbed( grab )

grabbooleanTrue to confine the mouse, false to let it leave the window.

love.mouse.setPosition

Sets the current position of the mouse. Non-integer values are floored.

love.mouse.setPosition( x, y )

xnumberThe new position of the mouse along the x-axis.
ynumberThe new position of the mouse along the y-axis.

love.mouse.setRelativeMode

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.

love.mouse.setRelativeMode( enable )

enablebooleanTrue to enable relative mode, false to disable it.

love.mouse.setVisible

Sets the current visibility of the cursor.

love.mouse.setVisible( visible )

visiblebooleanTrue to set the cursor to visible, false to hide the cursor.

love.mouse.setX

Sets the current X position of the mouse.

Non-integer values are floored.

love.mouse.setX( x )

xnumberThe new position of the mouse along the x-axis.

love.mouse.setY

Sets the current Y position of the mouse.

Non-integer values are floored.

love.mouse.setY( y )

ynumberThe new position of the mouse along the y-axis.

Cursor:getType

Gets the type of the Cursor.

ctype = Cursor:getType()

ctypeCursorTypeThe type of the Cursor.

CursorType

image

The cursor is using a custom image.

arrow

An arrow pointer.

ibeam

An I-beam, normally used when mousing over editable or selectable text.

wait

Wait graphic.

waitarrow

Small wait cursor with an arrow pointer.

crosshair

Crosshair symbol.

sizenwse

Double arrow pointing to the top-left and bottom-right.

sizenesw

Double arrow pointing to the top-right and bottom-left.

sizewe

Double arrow pointing left and right.

sizens

Double arrow pointing up and down.

sizeall

Four-pointed arrow pointing up, down, left, and right.

no

Slashed circle or crossbones.

hand

Hand symbol.

love.physics

love.physics.getDistance

Returns the two closest points between two fixtures and their distance.

distance, x1, y1, x2, y2 = love.physics.getDistance( fixture1, fixture2 )

distancenumberThe distance of the two points.
x1numberThe x-coordinate of the first point.
y1numberThe y-coordinate of the first point.
x2numberThe x-coordinate of the second point.
y2numberThe y-coordinate of the second point.
fixture1FixtureThe first fixture.
fixture2FixtureThe second fixture.

love.physics.getMeter

Returns the meter scale factor.

All coordinates in the physics module are divided by this number, creating a convenient way to draw the objects directly to the screen without the need for graphics transformations.

It is recommended to create shapes no larger than 10 times the scale. This is important because Box2D is tuned to work well with shape sizes from 0.1 to 10 meters.

scale = love.physics.getMeter()

scalenumberThe scale factor as an integer.

love.physics.newBody

Creates a new body.

There are three types of bodies.

* Static bodies do not move, have a infinite mass, and can be used for level boundaries.

* Dynamic bodies are the main actors in the simulation, they collide with everything.

* Kinematic bodies do not react to forces and only collide with dynamic bodies.

The mass of the body gets calculated when a Fixture is attached or removed, but can be changed at any time with Body:setMass or Body:resetMassData.

body = love.physics.newBody( world, x, y, type )

bodyBodyA new body.
worldWorldThe world to create the body in.
x (0)numberThe x position of the body.
y (0)numberThe y position of the body.
type ('static')BodyTypeThe type of the body.

love.physics.newChainShape

Creates a new ChainShape.

shape = love.physics.newChainShape( loop, x1, y1, x2, y2, ... )

shapeChainShapeThe new shape.
loopbooleanIf the chain should loop back to the first point.
x1numberThe x position of the first point.
y1numberThe y position of the first point.
x2numberThe x position of the second point.
y2numberThe y position of the second point.
...numberAdditional point positions.

shape = love.physics.newChainShape( loop, points )

shapeChainShapeThe new shape.
loopbooleanIf the chain should loop back to the first point.
pointstableA list of points to construct the ChainShape, in the form of {x1, y1, x2, y2, ...}.

love.physics.newCircleShape

Creates a new CircleShape.

shape = love.physics.newCircleShape( radius )

shapeCircleShapeThe new shape.
radiusnumberThe radius of the circle.

shape = love.physics.newCircleShape( x, y, radius )

shapeCircleShapeThe new shape.
xnumberThe x position of the circle.
ynumberThe y position of the circle.
radiusnumberThe radius of the circle.

love.physics.newDistanceJoint

Creates a DistanceJoint between two bodies.

This joint constrains the distance between two points on two bodies to be constant. These two points are specified in world coordinates and the two bodies are assumed to be in place when this joint is created. The first anchor point is connected to the first body and the second to the second body, and the points define the length of the distance joint.

joint = love.physics.newDistanceJoint( body1, body2, x1, y1, x2, y2, collideConnected )

jointDistanceJointThe new distance joint.
body1BodyThe first body to attach to the joint.
body2BodyThe second body to attach to the joint.
x1numberThe x position of the first anchor point (world space).
y1numberThe y position of the first anchor point (world space).
x2numberThe x position of the second anchor point (world space).
y2numberThe y position of the second anchor point (world space).
collideConnected (false)booleanSpecifies whether the two bodies should collide with each other.

love.physics.newEdgeShape

Creates a new EdgeShape.

shape = love.physics.newEdgeShape( x1, y1, x2, y2 )

shapeEdgeShapeThe new shape.
x1numberThe x position of the first point.
y1numberThe y position of the first point.
x2numberThe x position of the second point.
y2numberThe y position of the second point.

love.physics.newFixture

Creates and attaches a Fixture to a body.

Note that the Shape object is copied rather than kept as a reference when the Fixture is created. To get the Shape object that the Fixture owns, use Fixture:getShape.

fixture = love.physics.newFixture( body, shape, density )

fixtureFixtureThe new fixture.
bodyBodyThe body which gets the fixture attached.
shapeShapeThe shape to be copied to the fixture.
density (1)numberThe density of the fixture.

love.physics.newFrictionJoint

Create a friction joint between two bodies. A FrictionJoint applies friction to a body.

joint = love.physics.newFrictionJoint( body1, body2, x, y, collideConnected )

jointFrictionJointThe new FrictionJoint.
body1BodyThe first body to attach to the joint.
body2BodyThe second body to attach to the joint.
xnumberThe x position of the anchor point.
ynumberThe y position of the anchor point.
collideConnected (false)booleanSpecifies whether the two bodies should collide with each other.

joint = love.physics.newFrictionJoint( body1, body2, x1, y1, x2, y2, collideConnected )

jointFrictionJointThe new FrictionJoint.
body1BodyThe first body to attach to the joint.
body2BodyThe second body to attach to the joint.
x1numberThe x position of the first anchor point.
y1numberThe y position of the first anchor point.
x2numberThe x position of the second anchor point.
y2numberThe y position of the second anchor point.
collideConnected (false)booleanSpecifies whether the two bodies should collide with each other.

love.physics.newGearJoint

Create a GearJoint connecting two Joints.

The gear joint connects two joints that must be either prismatic or revolute joints. Using this joint requires that the joints it uses connect their respective bodies to the ground and have the ground as the first body. When destroying the bodies and joints you must make sure you destroy the gear joint before the other joints.

The gear joint has a ratio the determines how the angular or distance values of the connected joints relate to each other. The formula coordinate1 + ratio * coordinate2 always has a constant value that is set when the gear joint is created.

joint = love.physics.newGearJoint( joint1, joint2, ratio, collideConnected )

jointGearJointThe new gear joint.
joint1JointThe first joint to connect with a gear joint.
joint2JointThe second joint to connect with a gear joint.
ratio (1)numberThe gear ratio.
collideConnected (false)booleanSpecifies whether the two bodies should collide with each other.

love.physics.newMotorJoint

Creates a joint between two bodies which controls the relative motion between them.

Position and rotation offsets can be specified once the MotorJoint has been created, as well as the maximum motor force and torque that will be be applied to reach the target offsets.

joint = love.physics.newMotorJoint( body1, body2, correctionFactor )

jointMotorJointThe new MotorJoint.
body1BodyThe first body to attach to the joint.
body2BodyThe second body to attach to the joint.
correctionFactor (0.3)numberThe joint's initial position correction factor, in the range of 1.

joint = love.physics.newMotorJoint( body1, body2, correctionFactor, collideConnected )

jointMotorJointThe new MotorJoint.
body1BodyThe first body to attach to the joint.
body2BodyThe second body to attach to the joint.
correctionFactor (0.3)numberThe joint's initial position correction factor, in the range of 1.
collideConnected (false)booleanSpecifies whether the two bodies should collide with each other.

love.physics.newMouseJoint

Create a joint between a body and the mouse.

This joint actually connects the body to a fixed point in the world. To make it follow the mouse, the fixed point must be updated every timestep (example below).

The advantage of using a MouseJoint instead of just changing a body position directly is that collisions and reactions to other joints are handled by the physics engine.

joint = love.physics.newMouseJoint( body, x, y )

jointMouseJointThe new mouse joint.
bodyBodyThe body to attach to the mouse.
xnumberThe x position of the connecting point.
ynumberThe y position of the connecting point.

love.physics.newPolygonShape

Creates a new PolygonShape.

This shape can have 8 vertices at most, and must form a convex shape.

shape = love.physics.newPolygonShape( x1, y1, x2, y2, x3, y3, ... )

shapePolygonShapeA new PolygonShape.
x1numberThe x position of the first point.
y1numberThe y position of the first point.
x2numberThe x position of the second point.
y2numberThe y position of the second point.
x3numberThe x position of the third point.
y3numberThe y position of the third point.
...numberYou can continue passing more point positions to create the PolygonShape.

shape = love.physics.newPolygonShape( vertices )

shapePolygonShapeA new PolygonShape.
verticestableA list of vertices to construct the polygon, in the form of {x1, y1, x2, y2, x3, y3, ...}.

love.physics.newPrismaticJoint

Creates a PrismaticJoint between two bodies.

A prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a revolute joint, but with translation and force substituted for angle and torque.

joint = love.physics.newPrismaticJoint( body1, body2, x, y, ax, ay, collideConnected )

jointPrismaticJointThe new prismatic joint.
body1BodyThe first body to connect with a prismatic joint.
body2BodyThe second body to connect with a prismatic joint.
xnumberThe x coordinate of the anchor point.
ynumberThe y coordinate of the anchor point.
axnumberThe x coordinate of the axis vector.
aynumberThe y coordinate of the axis vector.
collideConnected (false)booleanSpecifies whether the two bodies should collide with each other.

joint = love.physics.newPrismaticJoint( body1, body2, x1, y1, x2, y2, ax, ay, collideConnected )

jointPrismaticJointThe new prismatic joint.
body1BodyThe first body to connect with a prismatic joint.
body2BodyThe second body to connect with a prismatic joint.
x1numberThe x coordinate of the first anchor point.
y1numberThe y coordinate of the first anchor point.
x2numberThe x coordinate of the second anchor point.
y2numberThe y coordinate of the second anchor point.
axnumberThe x coordinate of the axis unit vector.
aynumberThe y coordinate of the axis unit vector.
collideConnected (false)booleanSpecifies whether the two bodies should collide with each other.

joint = love.physics.newPrismaticJoint( body1, body2, x1, y1, x2, y2, ax, ay, collideConnected, referenceAngle )

jointPrismaticJointThe new prismatic joint.