Nocare3/love2dapi_chunks huggingface dataset:
PulleyJoint:setConstant
Set the total length of the rope.

Setting a new length for the rope updates the maximum length values of the joint.
PulleyJoint:setConstant( length )
length number The new length of the rope in the joint.
PulleyJoint:setMaxLengths
Set the maximum lengths of the rope segments.

The physics module also imposes maximum values for the rope segments. If the parameters exceed these values, the maximum values are set instead of the requested values.
PulleyJoint:setMaxLengths( max1, max2 )
max1 number The new maximum length of the first segment.
max2 number The new maximum length of the second segment.
PulleyJoint:setRatio
Set the pulley ratio.
PulleyJoint:setRatio( ratio )
ratio number The new pulley ratio of the joint.
RevoluteJoint:areLimitsEnabled
Checks whether limits are enabled.
enabled = RevoluteJoint:areLimitsEnabled()
enabled boolean True if enabled, false otherwise.
RevoluteJoint:getJointAngle
Get the current joint angle.
angle = RevoluteJoint:getJointAngle()
angle number The joint angle in radians.
RevoluteJoint:getJointSpeed
Get the current joint angle speed.
s = RevoluteJoint:getJointSpeed()
s number Joint angle speed in radians/second.
RevoluteJoint:getLimits
Gets the joint limits.
lower, upper = RevoluteJoint:getLimits()
lower number The lower limit, in radians.
upper number The upper limit, in radians.
RevoluteJoint:getLowerLimit
Gets the lower limit.
lower = RevoluteJoint:getLowerLimit()
lower number The lower limit, in radians.
RevoluteJoint:getMaxMotorTorque
Gets the maximum motor force.
f = RevoluteJoint:getMaxMotorTorque()
f number The maximum motor force, in Nm.
RevoluteJoint:getMotorSpeed
Gets the motor speed.
s = RevoluteJoint:getMotorSpeed()
s number The motor speed, radians per second.
RevoluteJoint:getMotorTorque
Get the current motor force.
f = RevoluteJoint:getMotorTorque()
f number The current motor force, in Nm.
RevoluteJoint:getReferenceAngle
Gets the reference angle.
angle = RevoluteJoint:getReferenceAngle()
angle number The reference angle in radians.
RevoluteJoint:getUpperLimit
Gets the upper limit.
upper = RevoluteJoint:getUpperLimit()
upper number The upper limit, in radians.
RevoluteJoint:hasLimitsEnabled
Checks whether limits are enabled.
enabled = RevoluteJoint:hasLimitsEnabled()
enabled boolean True if enabled, false otherwise.
RevoluteJoint:isMotorEnabled
Checks whether the motor is enabled.
enabled = RevoluteJoint:isMotorEnabled()
enabled boolean True if enabled, false if disabled.
RevoluteJoint:setLimits
Sets the limits.
RevoluteJoint:setLimits( lower, upper )
lower number The lower limit, in radians.
upper number The upper limit, in radians.
RevoluteJoint:setLimitsEnabled
Enables/disables the joint limit.
RevoluteJoint:setLimitsEnabled( enable )
enable boolean True to enable, false to disable.
RevoluteJoint:setLowerLimit
Sets the lower limit.
RevoluteJoint:setLowerLimit( lower )
lower number The lower limit, in radians.
RevoluteJoint:setMaxMotorTorque
Set the maximum motor force.
RevoluteJoint:setMaxMotorTorque( f )
f number The maximum motor force, in Nm.
RevoluteJoint:setMotorEnabled
Enables/disables the joint motor.
RevoluteJoint:setMotorEnabled( enable )
enable boolean True to enable, false to disable.
RevoluteJoint:setMotorSpeed
Sets the motor speed.
RevoluteJoint:setMotorSpeed( s )
s number The motor speed, radians per second.
RevoluteJoint:setUpperLimit
Sets the upper limit.
RevoluteJoint:setUpperLimit( upper )
upper number The upper limit, in radians.
RopeJoint:getMaxLength
Gets the maximum length of a RopeJoint.
maxLength = RopeJoint:getMaxLength()
maxLength number The maximum length of the RopeJoint.
RopeJoint:setMaxLength
Sets the maximum length of a RopeJoint.
RopeJoint:setMaxLength( maxLength )
maxLength number The new maximum length of the RopeJoint.
Shape:computeAABB
Returns the points of the bounding box for the transformed shape.
topLeftX, topLeftY, bottomRightX, bottomRightY = Shape:computeAABB( tx, ty, tr, childIndex )
tx number The translation of the shape on the x-axis.
ty number The translation of the shape on the y-axis.
tr number The shape rotation.
childIndex (1) number The index of the child to compute the bounding box of.
topLeftX number The x position of the top-left point.
topLeftY number The y position of the top-left point.
bottomRightX number The x position of the bottom-right point.
bottomRightY number The y position of the bottom-right point.
Shape:computeMass
Computes the mass properties for the shape with the specified density.
x, y, mass, inertia = Shape:computeMass( density )
density number The shape density.
x number The x postition of the center of mass.
y number The y postition of the center of mass.
mass number The mass of the shape.
inertia number The rotational inertia.
Shape:getChildCount
Returns the number of children the shape has.
count = Shape:getChildCount()
count number The number of children.
Shape:getRadius
Gets the radius of the shape.
radius = Shape:getRadius()
radius number The radius of the shape.
Shape:getType
Gets a string representing the Shape.

This function can be useful for conditional debug drawing.
type = Shape:getType()
type ShapeType The type of the Shape.
Shape:rayCast
Casts a ray against the shape and returns the surface normal vector and the line position where the ray hit. If the ray missed the shape, nil will be returned. The Shape can be transformed to get it into the desired position.

The ray starts on the first point of the input line and goes towards the second point of the line. The fourth argument is the maximum distance the ray is going to travel as a scale factor of the input line length.

The childIndex parameter is used to specify which child of a parent shape, such as a ChainShape, will be ray casted. For ChainShapes, the index of 1 is the first edge on the chain. Ray casting a parent shape will only test the child specified so if you want to test every shape of the parent, you must loop through all of its children.

The world position of the impact can be calculated by multiplying the line vector with the third return value and adding it to the line starting point.

hitx, hity = x1 + (x2 - x1) * fraction, y1 + (y2 - y1) * fraction
xn, yn, fraction = Shape:rayCast( x1, y1, x2, y2, maxFraction, tx, ty, tr, childIndex )
x1 number The x position of the input line starting point.
y1 number The y position of the input line starting point.
x2 number The x position of the input line end point.
y2 number The y position of the input line end point.
maxFraction number Ray length parameter.
tx number The translation of the shape on the x-axis.
ty number The translation of the shape on the y-axis.
tr number The shape rotation.
childIndex (1) number The index of the child the ray gets cast against.
xn number The x component of the normal vector of the edge where the ray hit the shape.
yn number The y component of the normal vector of the edge where the ray hit the shape.
fraction number The position on the input line where the intersection happened as a factor of the line length.
Shape:testPoint
This is particularly useful for mouse interaction with the shapes. By looping through all shapes and testing the mouse position with this function, we can find which shapes the mouse touches.
hit = Shape:testPoint( tx, ty, tr, x, y )
tx number Translates the shape along the x-axis.
ty number Translates the shape along the y-axis.
tr number Rotates the shape.
x number The x-component of the point.
y number The y-component of the point.
hit boolean True if inside, false if outside
WeldJoint:getDampingRatio
Returns the damping ratio of the joint.
ratio = WeldJoint:getDampingRatio()
ratio number The damping ratio.
WeldJoint:getFrequency
Returns the frequency.
freq = WeldJoint:getFrequency()
freq number The frequency in hertz.
WeldJoint:getReferenceAngle
Gets the reference angle.
angle = WeldJoint:getReferenceAngle()
angle number The reference angle in radians.
WeldJoint:setDampingRatio
Sets a new damping ratio.
WeldJoint:setDampingRatio( ratio )
ratio number The new damping ratio.
WeldJoint:setFrequency
Sets a new frequency.
WeldJoint:setFrequency( freq )
freq number The new frequency in hertz.
WheelJoint:getAxis
Gets the world-space axis vector of the Wheel Joint.
x, y = WheelJoint:getAxis()
x number The x-axis coordinate of the world-space axis vector.
y number The y-axis coordinate of the world-space axis vector.
WheelJoint:getJointSpeed
Returns the current joint translation speed.
speed = WheelJoint:getJointSpeed()
speed number The translation speed of the joint in meters per second.
WheelJoint:getJointTranslation
Returns the current joint translation.
position = WheelJoint:getJointTranslation()
position number The translation of the joint in meters.
WheelJoint:getMaxMotorTorque
Returns the maximum motor torque.
maxTorque = WheelJoint:getMaxMotorTorque()
maxTorque number The maximum torque of the joint motor in newton meters.
WheelJoint:getMotorSpeed
Returns the speed of the motor.
speed = WheelJoint:getMotorSpeed()
speed number The speed of the joint motor in radians per second.
WheelJoint:getMotorTorque
Returns the current torque on the motor.
torque = WheelJoint:getMotorTorque( invdt )
invdt number How long the force applies. Usually the inverse time step or 1/dt.
torque number The torque on the motor in newton meters.
WheelJoint:getSpringDampingRatio
Returns the damping ratio.
ratio = WheelJoint:getSpringDampingRatio()
ratio number The damping ratio.
WheelJoint:getSpringFrequency
Returns the spring frequency.
freq = WheelJoint:getSpringFrequency()
freq number The frequency in hertz.
WheelJoint:isMotorEnabled
Checks if the joint motor is running.
on = WheelJoint:isMotorEnabled()
on boolean The status of the joint motor.
WheelJoint:setMaxMotorTorque
Sets a new maximum motor torque.
WheelJoint:setMaxMotorTorque( maxTorque )
maxTorque number The new maximum torque for the joint motor in newton meters.
WheelJoint:setMotorEnabled
Starts and stops the joint motor.
WheelJoint:setMotorEnabled( enable )
enable boolean True turns the motor on and false turns it off.
WheelJoint:setMotorSpeed
Sets a new speed for the motor.
WheelJoint:setMotorSpeed( speed )
speed number The new speed for the joint motor in radians per second.
WheelJoint:setSpringDampingRatio
Sets a new damping ratio.
WheelJoint:setSpringDampingRatio( ratio )
ratio number The new damping ratio.
WheelJoint:setSpringFrequency
Sets a new spring frequency.
WheelJoint:setSpringFrequency( freq )
freq number The new frequency in hertz.
World:destroy
Destroys the world, taking all bodies, joints, fixtures and their shapes with it.

An error will occur if you attempt to use any of the destroyed objects after calling this function.
World:destroy()
World:getBodies
Returns a table with all bodies.
bodies = World:getBodies()
bodies table A sequence with all bodies.
World:getBodyCount
Returns the number of bodies in the world.
n = World:getBodyCount()
n number The number of bodies in the world.
World:getCallbacks
Returns functions for the callbacks during the world update.
beginContact, endContact, preSolve, postSolve = World:getCallbacks()
beginContact function Gets called when two fixtures begin to overlap.
endContact function Gets called when two fixtures cease to overlap.
preSolve function Gets called before a collision gets resolved.
postSolve function Gets called after the collision has been resolved.
World:getContactCount
Returns the number of contacts in the world.
n = World:getContactCount()
n number The number of contacts in the world.
World:getContactFilter
Returns the function for collision filtering.
contactFilter = World:getContactFilter()
contactFilter function The function that handles the contact filtering.
World:getContacts
Returns a table with all Contacts.
contacts = World:getContacts()
contacts table A sequence with all Contacts.
World:getGravity
Get the gravity of the world.
x, y = World:getGravity()
x number The x component of gravity.
y number The y component of gravity.
World:getJointCount
Returns the number of joints in the world.
n = World:getJointCount()
n number The number of joints in the world.
World:getJoints
Returns a table with all joints.
joints = World:getJoints()
joints table A sequence with all joints.
World:isDestroyed
Gets whether the World is destroyed. Destroyed worlds cannot be used.
destroyed = World:isDestroyed()
destroyed boolean Whether the World is destroyed.
World:isLocked
Returns if the world is updating its state.

This will return true inside the callbacks from World:setCallbacks.
locked = World:isLocked()
locked boolean Will be true if the world is in the process of updating its state.
World:isSleepingAllowed
Gets the sleep behaviour of the world.
allow = World:isSleepingAllowed()
allow boolean True if bodies in the world are allowed to sleep, or false if not.
World:queryBoundingBox
Calls a function for each fixture inside the specified area by searching for any overlapping bounding box (Fixture:getBoundingBox).
World:queryBoundingBox( topLeftX, topLeftY, bottomRightX, bottomRightY, callback )
topLeftX number The x position of the top-left point.
topLeftY number The y position of the top-left point.
bottomRightX number The x position of the bottom-right point.
bottomRightY number The y position of the bottom-right point.
callback function This function gets passed one argument, the fixture, and should return a boolean. The search will continue if it is true or stop if it is false.
World:rayCast
Casts a ray and calls a function for each fixtures it intersects.
World:rayCast( x1, y1, x2, y2, callback )
x1 number The x position of the starting point of the ray.
y1 number The x position of the starting point of the ray.
x2 number The x position of the end point of the ray.
y2 number The x value of the surface normal vector of the shape edge.
callback function A function called for each fixture intersected by the ray. The function gets six arguments and should return a number as a control value. The intersection points fed into the function will be in an arbitrary order. If you wish to find the closest point of intersection, you'll need to do that yourself within the function. The easiest way to do that is by using the fraction value.
World:setCallbacks
Sets functions for the collision callbacks during the world update.

Four Lua functions can be given as arguments. The value nil removes a function.

When called, each function will be passed three arguments. The first two arguments are the colliding fixtures and the third argument is the Contact between them. The postSolve callback additionally gets the normal and tangent impulse for each contact point. See notes.

If you are interested to know when exactly each callback is called, consult a Box2d manual
World:setCallbacks( beginContact, endContact, preSolve, postSolve )
beginContact function Gets called when two fixtures begin to overlap.
endContact function Gets called when two fixtures cease to overlap. This will also be called outside of a world update, when colliding objects are destroyed.
preSolve (nil) function Gets called before a collision gets resolved.
postSolve (nil) function Gets called after the collision has been resolved.
World:setContactFilter
Sets a function for collision filtering.

If the group and category filtering doesn't generate a collision decision, this function gets called with the two fixtures as arguments. The function should return a boolean value where true means the fixtures will collide and false means they will pass through each other.
World:setContactFilter( filter )
filter function The function handling the contact filtering.
World:setGravity
Set the gravity of the world.
World:setGravity( x, y )
x number The x component of gravity.
y number The y component of gravity.
World:setSleepingAllowed
Sets the sleep behaviour of the world.
World:setSleepingAllowed( allow )
allow boolean True if bodies in the world are allowed to sleep, or false if not.
World:translateOrigin
Translates the World's origin. Useful in large worlds where floating point precision issues become noticeable at far distances from the origin.
World:translateOrigin( x, y )
x number The x component of the new origin with respect to the old origin.
y number The y component of the new origin with respect to the old origin.
World:update
Update the state of the world.
World:update( dt, velocityiterations, positioniterations )
dt number The time (in seconds) to advance the physics simulation.
velocityiterations (8) number The maximum number of steps used to determine the new velocities when resolving a collision.
positioniterations (3) number The maximum number of steps used to determine the new positions when resolving a collision.
love.sound.newDecoder
Attempts to find a decoder for the encoded sound data in the specified file.
decoder = love.sound.newDecoder( file, buffer )
file File The file with encoded sound data.
buffer (2048) number The size of each decoded chunk, in bytes.
decoder Decoder A new Decoder object.
decoder = love.sound.newDecoder( filename, buffer )
filename string The filename of the file with encoded sound data.
buffer (2048) number The size of each decoded chunk, in bytes.
decoder Decoder A new Decoder object.
love.sound.newSoundData
Creates new SoundData from a filepath, File, or Decoder. It's also possible to create SoundData with a custom sample rate, channel and bit depth.

The sound data will be decoded to the memory in a raw format. It is recommended to create only short sounds like effects, as a 3 minute song uses 30 MB of memory this way.
soundData = love.sound.newSoundData( filename )
filename string The file name of the file to load.
soundData SoundData A new SoundData object.
soundData = love.sound.newSoundData( file )
file File A File pointing to an audio file.
soundData SoundData A new SoundData object.
soundData = love.sound.newSoundData( decoder )
decoder Decoder Decode data from this Decoder until EOF.
soundData SoundData A new SoundData object.
soundData = love.sound.newSoundData( samples, rate, bits, channels )
samples number Total number of samples.
rate (44100) number Number of samples per second
bits (16) number Bits per sample (8 or 16).
channels (2) number Either 1 for mono or 2 for stereo.
soundData SoundData A new SoundData object.
Decoder:clone
Creates a new copy of current decoder.

The new decoder will start decoding from the beginning of the audio stream.
decoder = Decoder:clone()
decoder Decoder New copy of the decoder.
Decoder:decode
Decodes the audio and returns a SoundData object containing the decoded audio data.
soundData = Decoder:decode()
soundData SoundData Decoded audio data.
Decoder:getBitDepth
Returns the number of bits per sample.
bitDepth = Decoder:getBitDepth()
bitDepth number Either 8, or 16.
Decoder:getChannelCount
Returns the number of channels in the stream.
channels = Decoder:getChannelCount()
channels number 1 for mono, 2 for stereo.
Decoder:getDuration
Gets the duration of the sound file. It may not always be sample-accurate, and it may return -1 if the duration cannot be determined at all.
duration = Decoder:getDuration()
duration number The duration of the sound file in seconds, or -1 if it cannot be determined.
Decoder:getSampleRate
Returns the sample rate of the Decoder.
rate = Decoder:getSampleRate()
rate number Number of samples per second.
Decoder:seek
Sets the currently playing position of the Decoder.
Decoder:seek( offset )
offset number The position to seek to, in seconds.
SoundData:getBitDepth
Returns the number of bits per sample.
bitdepth = SoundData:getBitDepth()
bitdepth number Either 8, or 16.
SoundData:getChannelCount
Returns the number of channels in the SoundData.
channels = SoundData:getChannelCount()
channels number 1 for mono, 2 for stereo.
SoundData:getDuration
Gets the duration of the sound data.
duration = SoundData:getDuration()
duration number The duration of the sound data in seconds.
SoundData:getSample
Gets the value of the sample-point at the specified position. For stereo SoundData objects, the data from the left and right channels are interleaved in that order.
sample = SoundData:getSample( i )
i number An integer value specifying the position of the sample (starting at 0).
sample number The normalized samplepoint (range -1.0 to 1.0).
sample = SoundData:getSample( i, channel )
i number An integer value specifying the position of the sample (starting at 0).
channel number The index of the channel to get within the given sample.
sample number The normalized samplepoint (range -1.0 to 1.0).
SoundData:getSampleCount
Returns the number of samples per channel of the SoundData.
count = SoundData:getSampleCount()
count number Total number of samples.
SoundData:getSampleRate
Returns the sample rate of the SoundData.
rate = SoundData:getSampleRate()
rate number Number of samples per second.
SoundData:setSample
Sets the value of the sample-point at the specified position. For stereo SoundData objects, the data from the left and right channels are interleaved in that order.
SoundData:setSample( i, sample )
i number An integer value specifying the position of the sample (starting at 0).
sample number The normalized samplepoint (range -1.0 to 1.0).
SoundData:setSample( i, channel, sample )
i number An integer value specifying the position of the sample (starting at 0).
channel number The index of the channel to set within the given sample.
sample number The normalized samplepoint (range -1.0 to 1.0).
love.system.getClipboardText
Gets text from the clipboard.
text = love.system.getClipboardText()
text string The text currently held in the system's clipboard.
love.system.getOS
Gets the current operating system. In general, LÖVE abstracts away the need to know the current operating system, but there are a few cases where it can be useful (especially in combination with os.execute.)
osString = love.system.getOS()
osString string The current operating system. 'OS X', 'Windows', 'Linux', 'Android' or 'iOS'.
love.system.getPowerInfo
Gets information about the system's power supply.
state, percent, seconds = love.system.getPowerInfo()
state PowerState The basic state of the power supply.
percent number Percentage of battery life left, between 0 and 100. nil if the value can't be determined or there's no battery.
seconds number Seconds of battery life left. nil if the value can't be determined or there's no battery.
love.system.getProcessorCount
Gets the amount of logical processor in the system.
processorCount = love.system.getProcessorCount()
processorCount number Amount of logical processors.
love.system.hasBackgroundMusic
Gets whether another application on the system is playing music in the background.

Currently this is implemented on iOS and Android, and will always return false on other operating systems. The t.audio.mixwithsystem flag in love.conf can be used to configure whether background audio / music from other apps should play while LÖVE is open.
backgroundmusic = love.system.hasBackgroundMusic()
backgroundmusic boolean True if the user is playing music in the background via another app, false otherwise.
love.system.openURL
Opens a URL with the user's web or file browser.
success = love.system.openURL( url )
url string The URL to open. Must be formatted as a proper URL.
success boolean Whether the URL was opened successfully.
love.system.setClipboardText
Puts text in the clipboard.
love.system.setClipboardText( text )
text string The new text to hold in the system's clipboard.
love.system.vibrate
Causes the device to vibrate, if possible. Currently this will only work on Android and iOS devices that have a built-in vibration motor.
love.system.vibrate( seconds )
seconds (0.5) number The duration to vibrate for. If called on an iOS device, it will always vibrate for 0.5 seconds due to limitations in the iOS system APIs.
love.thread.getChannel
Creates or retrieves a named thread channel.
channel = love.thread.getChannel( name )
name string The name of the channel you want to create or retrieve.
channel Channel The Channel object associated with the name.
love.thread.newChannel
Create a new unnamed thread channel.

One use for them is to pass new unnamed channels to other threads via Channel:push on a named channel.
channel = love.thread.newChannel()
channel Channel The new Channel object.