Nocare3/love2dapi_chunks huggingface dataset:
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()
enabled boolean True 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 )
ctype CursorType The type of system cursor to get.
cursor Cursor The Cursor object representing the system cursor type.
love.mouse.getX
Returns the current x-position of the mouse.
x = love.mouse.getX()
x number The position of the mouse along the x-axis.
love.mouse.getY
Returns the current y-position of the mouse.
y = love.mouse.getY()
y number The position of the mouse along the y-axis.
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()
supported boolean Whether 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, ... )
button number The index of a button to check. 1 is the primary mouse button, 2 is the secondary mouse button and 3 is the middle button. Further buttons are mouse dependant.
... number Additional button numbers to check.
down boolean True if any specified button is down.
love.mouse.isGrabbed
Checks if the mouse is grabbed.
grabbed = love.mouse.isGrabbed()
grabbed boolean True if the cursor is grabbed, false if it is not.
love.mouse.isVisible
Checks if the cursor is visible.
visible = love.mouse.isVisible()
visible boolean True 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 )
imageData ImageData The ImageData to use for the new Cursor.
hotx (0) number The x-coordinate in the ImageData of the cursor's hot spot.
hoty (0) number The y-coordinate in the ImageData of the cursor's hot spot.
cursor Cursor The new Cursor object.
cursor = love.mouse.newCursor( filename, hotx, hoty )
filename string Path to the image to use for the new Cursor.
hotx (0) number The x-coordinate in the image of the cursor's hot spot.
hoty (0) number The y-coordinate in the image of the cursor's hot spot.
cursor Cursor The new Cursor object.
cursor = love.mouse.newCursor( fileData, hotx, hoty )
fileData FileData Data representing the image to use for the new Cursor.
hotx (0) number The x-coordinate in the image of the cursor's hot spot.
hoty (0) number The y-coordinate in the image of the cursor's hot spot.
cursor Cursor The new Cursor object.
love.mouse.setCursor
Sets the current mouse cursor.
love.mouse.setCursor( cursor )
cursor Cursor The 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 )
grab boolean True 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 )
x number The new position of the mouse along the x-axis.
y number The 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 )
enable boolean True to enable relative mode, false to disable it.
love.mouse.setVisible
Sets the current visibility of the cursor.
love.mouse.setVisible( visible )
visible boolean True 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 )
x number The 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 )
y number The new position of the mouse along the y-axis.
Cursor:getType
Gets the type of the Cursor.
ctype = Cursor:getType()
ctype CursorType The type of the Cursor.
love.physics.getDistance
Returns the two closest points between two fixtures and their distance.
distance, x1, y1, x2, y2 = love.physics.getDistance( fixture1, fixture2 )
fixture1 Fixture The first fixture.
fixture2 Fixture The second fixture.
distance number The distance of the two points.
x1 number The x-coordinate of the first point.
y1 number The y-coordinate of the first point.
x2 number The x-coordinate of the second point.
y2 number The y-coordinate of the second point.
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()
scale number The 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 )
world World The world to create the body in.
x (0) number The x position of the body.
y (0) number The y position of the body.
type ('static') BodyType The type of the body.
body Body A new body.
love.physics.newChainShape
Creates a new ChainShape.
shape = love.physics.newChainShape( loop, x1, y1, x2, y2, ... )
loop boolean If the chain should loop back to the first point.
x1 number The x position of the first point.
y1 number The y position of the first point.
x2 number The x position of the second point.
y2 number The y position of the second point.
... number Additional point positions.
shape ChainShape The new shape.
shape = love.physics.newChainShape( loop, points )
loop boolean If the chain should loop back to the first point.
points table A list of points to construct the ChainShape, in the form of {x1, y1, x2, y2, ...}.
shape ChainShape The new shape.
love.physics.newCircleShape
Creates a new CircleShape.
shape = love.physics.newCircleShape( radius )
radius number The radius of the circle.
shape CircleShape The new shape.
shape = love.physics.newCircleShape( x, y, radius )
x number The x position of the circle.
y number The y position of the circle.
radius number The radius of the circle.
shape CircleShape The new shape.
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 )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the joint.
x1 number The x position of the first anchor point (world space).
y1 number The y position of the first anchor point (world space).
x2 number The x position of the second anchor point (world space).
y2 number The y position of the second anchor point (world space).
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint DistanceJoint The new distance joint.
love.physics.newEdgeShape
Creates a new EdgeShape.
shape = love.physics.newEdgeShape( x1, y1, x2, y2 )
x1 number The x position of the first point.
y1 number The y position of the first point.
x2 number The x position of the second point.
y2 number The y position of the second point.
shape EdgeShape The new shape.
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 )
body Body The body which gets the fixture attached.
shape Shape The shape to be copied to the fixture.
density (1) number The density of the fixture.
fixture Fixture The new 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 )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the joint.
x number The x position of the anchor point.
y number The y position of the anchor point.
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint FrictionJoint The new FrictionJoint.
joint = love.physics.newFrictionJoint( body1, body2, x1, y1, x2, y2, collideConnected )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the joint.
x1 number The x position of the first anchor point.
y1 number The y position of the first anchor point.
x2 number The x position of the second anchor point.
y2 number The y position of the second anchor point.
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint FrictionJoint The new FrictionJoint.
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 )
joint1 Joint The first joint to connect with a gear joint.
joint2 Joint The second joint to connect with a gear joint.
ratio (1) number The gear ratio.
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint GearJoint The new gear joint.
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 )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the joint.
correctionFactor (0.3) number The joint's initial position correction factor, in the range of 1.
joint MotorJoint The new MotorJoint.
joint = love.physics.newMotorJoint( body1, body2, correctionFactor, collideConnected )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the joint.
correctionFactor (0.3) number The joint's initial position correction factor, in the range of 1.
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint MotorJoint The new MotorJoint.
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 )
body Body The body to attach to the mouse.
x number The x position of the connecting point.
y number The y position of the connecting point.
joint MouseJoint The new mouse joint.
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, ... )
x1 number The x position of the first point.
y1 number The y position of the first point.
x2 number The x position of the second point.
y2 number The y position of the second point.
x3 number The x position of the third point.
y3 number The y position of the third point.
... number You can continue passing more point positions to create the PolygonShape.
shape PolygonShape A new PolygonShape.
shape = love.physics.newPolygonShape( vertices )
vertices table A list of vertices to construct the polygon, in the form of {x1, y1, x2, y2, x3, y3, ...}.
shape PolygonShape A new PolygonShape.
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 )
body1 Body The first body to connect with a prismatic joint.
body2 Body The second body to connect with a prismatic joint.
x number The x coordinate of the anchor point.
y number The y coordinate of the anchor point.
ax number The x coordinate of the axis vector.
ay number The y coordinate of the axis vector.
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint PrismaticJoint The new prismatic joint.
joint = love.physics.newPrismaticJoint( body1, body2, x1, y1, x2, y2, ax, ay, collideConnected )
body1 Body The first body to connect with a prismatic joint.
body2 Body The second body to connect with a prismatic joint.
x1 number The x coordinate of the first anchor point.
y1 number The y coordinate of the first anchor point.
x2 number The x coordinate of the second anchor point.
y2 number The y coordinate of the second anchor point.
ax number The x coordinate of the axis unit vector.
ay number The y coordinate of the axis unit vector.
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint PrismaticJoint The new prismatic joint.
joint = love.physics.newPrismaticJoint( body1, body2, x1, y1, x2, y2, ax, ay, collideConnected, referenceAngle )
body1 Body The first body to connect with a prismatic joint.
body2 Body The second body to connect with a prismatic joint.
x1 number The x coordinate of the first anchor point.
y1 number The y coordinate of the first anchor point.
x2 number The x coordinate of the second anchor point.
y2 number The y coordinate of the second anchor point.
ax number The x coordinate of the axis unit vector.
ay number The y coordinate of the axis unit vector.
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
referenceAngle (0) number The reference angle between body1 and body2, in radians.
joint PrismaticJoint The new prismatic joint.
love.physics.newPulleyJoint
Creates a PulleyJoint to join two bodies to each other and the ground.

The pulley joint simulates a pulley with an optional block and tackle. If the ratio parameter has a value different from one, then the simulated rope extends faster on one side than the other. In a pulley joint the total length of the simulated rope is the constant length1 + ratio * length2, which is set when the pulley joint is created.

Pulley joints can behave unpredictably if one side is fully extended. It is recommended that the method setMaxLengths  be used to constrain the maximum lengths each side can attain.
joint = love.physics.newPulleyJoint( body1, body2, gx1, gy1, gx2, gy2, x1, y1, x2, y2, ratio, collideConnected )
body1 Body The first body to connect with a pulley joint.
body2 Body The second body to connect with a pulley joint.
gx1 number The x coordinate of the first body's ground anchor.
gy1 number The y coordinate of the first body's ground anchor.
gx2 number The x coordinate of the second body's ground anchor.
gy2 number The y coordinate of the second body's ground anchor.
x1 number The x coordinate of the pulley joint anchor in the first body.
y1 number The y coordinate of the pulley joint anchor in the first body.
x2 number The x coordinate of the pulley joint anchor in the second body.
y2 number The y coordinate of the pulley joint anchor in the second body.
ratio (1) number The joint ratio.
collideConnected (true) boolean Specifies whether the two bodies should collide with each other.
joint PulleyJoint The new pulley joint.
love.physics.newRectangleShape
Shorthand for creating rectangular PolygonShapes.

By default, the local origin is located at the '''center''' of the rectangle as opposed to the top left for graphics.
shape = love.physics.newRectangleShape( width, height )
width number The width of the rectangle.
height number The height of the rectangle.
shape PolygonShape A new PolygonShape.
shape = love.physics.newRectangleShape( x, y, width, height, angle )
x number The offset along the x-axis.
y number The offset along the y-axis.
width number The width of the rectangle.
height number The height of the rectangle.
angle (0) number The initial angle of the rectangle.
shape PolygonShape A new PolygonShape.
love.physics.newRevoluteJoint
Creates a pivot joint between two bodies.

This joint connects two bodies to a point around which they can pivot.
joint = love.physics.newRevoluteJoint( body1, body2, x, y, collideConnected )
body1 Body The first body.
body2 Body The second body.
x number The x position of the connecting point.
y number The y position of the connecting point.
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint RevoluteJoint The new revolute joint.
joint = love.physics.newRevoluteJoint( body1, body2, x1, y1, x2, y2, collideConnected, referenceAngle )
body1 Body The first body.
body2 Body The second body.
x1 number The x position of the first connecting point.
y1 number The y position of the first connecting point.
x2 number The x position of the second connecting point.
y2 number The y position of the second connecting point.
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
referenceAngle (0) number The reference angle between body1 and body2, in radians.
joint RevoluteJoint The new revolute joint.
love.physics.newRopeJoint
Creates a joint between two bodies. Its only function is enforcing a max distance between these bodies.
joint = love.physics.newRopeJoint( body1, body2, x1, y1, x2, y2, maxLength, collideConnected )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the joint.
x1 number The x position of the first anchor point.
y1 number The y position of the first anchor point.
x2 number The x position of the second anchor point.
y2 number The y position of the second anchor point.
maxLength number The maximum distance for the bodies.
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint RopeJoint The new RopeJoint.
love.physics.newWeldJoint
Creates a constraint joint between two bodies. A WeldJoint essentially glues two bodies together. The constraint is a bit soft, however, due to Box2D's iterative solver.
joint = love.physics.newWeldJoint( body1, body2, x, y, collideConnected )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the joint.
x number The x position of the anchor point (world space).
y number The y position of the anchor point (world space).
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint WeldJoint The new WeldJoint.
joint = love.physics.newWeldJoint( body1, body2, x1, y1, x2, y2, collideConnected )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the joint.
x1 number The x position of the first anchor point (world space).
y1 number The y position of the first anchor point (world space).
x2 number The x position of the second anchor point (world space).
y2 number The y position of the second anchor point (world space).
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
joint WeldJoint The new WeldJoint.
joint = love.physics.newWeldJoint( body1, body2, x1, y1, x2, y2, collideConnected, referenceAngle )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the joint.
x1 number The x position of the first anchor point (world space).
y1 number The y position of the first anchor point (world space).
x2 number The x position of the second anchor point (world space).
y2 number The y position of the second anchor point (world space).
collideConnected (false) boolean Specifies whether the two bodies should collide with each other.
referenceAngle (0) number The reference angle between body1 and body2, in radians.
joint WeldJoint The new WeldJoint.