main function
stringlengths
8
40
chunks
stringlengths
41
8.32k
repo_name
stringclasses
1 value
Joystick:getDeviceInfo
Joystick:getDeviceInfo Gets the USB vendor ID, product ID, and product version numbers of joystick which consistent across operating systems. Can be used to show different icons, etc. for different gamepads. vendorID, productID, productVersion = Joystick:getDeviceInfo() vendorID number The USB vendor ID of the joystic...
love2d-community.github.io/love-api
Joystick:getGUID
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() guid string The Joystick type's OS-dependent unique identifier.
love2d-community.github.io/love-api
Joystick:getGamepadAxis
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 ) axis GamepadAxis The virtual axis to be checked. direction number Current value of the axis.
love2d-community.github.io/love-api
Joystick:getGamepadMapping
Joystick:getGamepadMapping Gets the button, axis or hat that a virtual gamepad input is bound to. inputtype, inputindex, hatdirection = Joystick:getGamepadMapping( axis ) axis GamepadAxis The virtual gamepad axis to get the binding for. inputtype JoystickInputType The type of input the virtual gamepad axis is bound to....
love2d-community.github.io/love-api
Joystick:getGamepadMappingString
Joystick:getGamepadMappingString Gets the full gamepad mapping string of this Joystick, or nil if it's not recognized as a gamepad. The mapping string contains binding information used to map the Joystick's buttons an axes to the standard gamepad layout, and can be used later with love.joystick.loadGamepadMappings. ma...
love2d-community.github.io/love-api
Joystick:getHat
Joystick:getHat Gets the direction of the Joystick's hat. direction = Joystick:getHat( hat ) hat number The index of the hat to be checked. direction JoystickHat The direction the hat is pushed.
love2d-community.github.io/love-api
Joystick:getHatCount
Joystick:getHatCount Gets the number of hats on the joystick. hats = Joystick:getHatCount() hats number How many hats the joystick has.
love2d-community.github.io/love-api
Joystick:getID
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() id number The Joystick's unique identifier. Remains the sam...
love2d-community.github.io/love-api
Joystick:getName
Joystick:getName Gets the name of the joystick. name = Joystick:getName() name string The name of the joystick.
love2d-community.github.io/love-api
Joystick:getVibration
Joystick:getVibration Gets the current vibration motor strengths on a Joystick with rumble support. left, right = Joystick:getVibration() left number Current strength of the left vibration motor on the Joystick. right number Current strength of the right vibration motor on the Joystick.
love2d-community.github.io/love-api
Joystick:isConnected
Joystick:isConnected Gets whether the Joystick is connected. connected = Joystick:isConnected() connected boolean True if the Joystick is currently connected, false otherwise.
love2d-community.github.io/love-api
Joystick:isDown
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 ) buttonN number The index of a ...
love2d-community.github.io/love-api
Joystick:isGamepad
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...
love2d-community.github.io/love-api
Joystick:isGamepadDown
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 ) buttonN GamepadButton The gamepad button to check. anyDown boolean True if any...
love2d-community.github.io/love-api
Joystick:isVibrationSupported
Joystick:isVibrationSupported Gets whether the Joystick supports vibration. supported = Joystick:isVibrationSupported() supported boolean True if rumble / force feedback vibration is supported on this Joystick, false if not.
love2d-community.github.io/love-api
Joystick:setVibration
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 ) left number Strength of the left vibration motor...
love2d-community.github.io/love-api
love.keyboard.getKeyFromScancode
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 ...
love2d-community.github.io/love-api
love.keyboard.getScancodeFromKey
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 ...
love2d-community.github.io/love-api
love.keyboard.hasKeyRepeat
love.keyboard.hasKeyRepeat Gets whether key repeat is enabled. enabled = love.keyboard.hasKeyRepeat() enabled boolean Whether key repeat is enabled.
love2d-community.github.io/love-api
love.keyboard.hasScreenKeyboard
love.keyboard.hasScreenKeyboard Gets whether screen keyboard is supported. supported = love.keyboard.hasScreenKeyboard() supported boolean Whether screen keyboard is supported.
love2d-community.github.io/love-api
love.keyboard.hasTextInput
love.keyboard.hasTextInput Gets whether text input events are enabled. enabled = love.keyboard.hasTextInput() enabled boolean Whether text input events are enabled.
love2d-community.github.io/love-api
love.keyboard.isDown
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 ) key KeyConstant The key to check. down boolean True if the key is down, false if not. anyDown = love.keyboard.isDown( key, ... ) key KeyConstant A key to check. ... ...
love2d-community.github.io/love-api
love.keyboard.isScancodeDown
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, ...
love2d-community.github.io/love-api
love.keyboard.setKeyRepeat
love.keyboard.setKeyRepeat Enables or disables key repeat for love.keypressed. It is disabled by default. love.keyboard.setKeyRepeat( enable ) enable boolean Whether repeat keypress events should be enabled when a key is held down.
love2d-community.github.io/love-api
love.keyboard.setTextInput
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 ) enable boolean Whether text inpu...
love2d-community.github.io/love-api
love.math.colorFromBytes
love.math.colorFromBytes Converts a color from 0..255 to 0..1 range. r, g, b, a = love.math.colorFromBytes( rb, gb, bb, ab ) rb number Red color component in 0..255 range. gb number Green color component in 0..255 range. bb number Blue color component in 0..255 range. ab (nil) number Alpha color component in 0..255 ran...
love2d-community.github.io/love-api
love.math.colorToBytes
love.math.colorToBytes Converts a color from 0..1 to 0..255 range. rb, gb, bb, ab = love.math.colorToBytes( r, g, b, a ) r number Red color component. g number Green color component. b number Blue color component. a (nil) number Alpha color component. rb number Red color component in 0..255 range. gb number Green color...
love2d-community.github.io/love-api
love.math.gammaToLinear
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 version...
love2d-community.github.io/love-api
love.math.getRandomSeed
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() low number In...
love2d-community.github.io/love-api
love.math.getRandomState
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 numb...
love2d-community.github.io/love-api
love.math.isConvex
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 ) vertices table The vertices of the polygon as a table in the form of {x1, y1, x2, y2, x3, y3,...
love2d-community.github.io/love-api
love.math.linearToGamma
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 ...
love2d-community.github.io/love-api
love.math.newBezierCurve
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 ) vertices t...
love2d-community.github.io/love-api
love.math.newRandomGenerator
love.math.newRandomGenerator Creates a new RandomGenerator object which is completely independent of other RandomGenerator objects and random functions. rng = love.math.newRandomGenerator() rng RandomGenerator The new Random Number Generator object. rng = love.math.newRandomGenerator( seed ) seed number The initial see...
love2d-community.github.io/love-api
love.math.newTransform
love.math.newTransform Creates a new Transform object. transform = love.math.newTransform() transform Transform The new Transform object. transform = love.math.newTransform( x, y, angle, sx, sy, ox, oy, kx, ky ) x number The position of the new Transform on the x-axis. y number The position of the new Transform on the ...
love2d-community.github.io/love-api
love.math.noise
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 deta...
love2d-community.github.io/love-api
love.math.random
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() number number The pseudo-random number. number = love.math.random( max ) max number The maximum possible v...
love2d-community.github.io/love-api
love.math.randomNormal
love.math.randomNormal Get a normally distributed pseudo random number. number = love.math.randomNormal( stddev, mean ) stddev (1) number Standard deviation of the distribution. mean (0) number The mean of the distribution. number number Normally distributed random number with variance (stddev)² and the specified mean.
love2d-community.github.io/love-api
love.math.setRandomSeed
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 ) seed number The integer number with which you want to seed the randomization. Must be within the...
love2d-community.github.io/love-api
love.math.setRandomState
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 ...
love2d-community.github.io/love-api
love.math.triangulate
love.math.triangulate Decomposes a simple convex or concave polygon into triangles. triangles = love.math.triangulate( polygon ) polygon table Polygon to triangulate. Must not intersect itself. triangles table List of triangles the polygon is composed of, in the form of {{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y...
love2d-community.github.io/love-api
BezierCurve:evaluate
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 ) t number ...
love2d-community.github.io/love-api
BezierCurve:getControlPoint
BezierCurve:getControlPoint Get coordinates of the i-th control point. Indices start with 1. x, y = BezierCurve:getControlPoint( i ) i number Index of the control point. x number Position of the control point along the x axis. y number Position of the control point along the y axis.
love2d-community.github.io/love-api
BezierCurve:getControlPointCount
BezierCurve:getControlPointCount Get the number of control points in the Bézier curve. count = BezierCurve:getControlPointCount() count number The number of control points.
love2d-community.github.io/love-api
BezierCurve:getDegree
BezierCurve:getDegree Get degree of the Bézier curve. The degree is equal to number-of-control-points - 1. degree = BezierCurve:getDegree() degree number Degree of the Bézier curve.
love2d-community.github.io/love-api
BezierCurve:getDerivative
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() derivative BezierCurve The derivative cu...
love2d-community.github.io/love-api
BezierCurve:getSegment
BezierCurve:getSegment Gets a BezierCurve that corresponds to the specified segment of this BezierCurve. curve = BezierCurve:getSegment( startpoint, endpoint ) startpoint number The starting point along the curve. Must be between 0 and 1. endpoint number The end of the segment. Must be between 0 and 1. curve BezierCurv...
love2d-community.github.io/love-api
BezierCurve:insertControlPoint
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 ) x number Position o...
love2d-community.github.io/love-api
BezierCurve:removeControlPoint
BezierCurve:removeControlPoint Removes the specified control point. BezierCurve:removeControlPoint( index ) index number The index of the control point to remove.
love2d-community.github.io/love-api
BezierCurve:render
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. ...
love2d-community.github.io/love-api
BezierCurve:renderSegment
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 par...
love2d-community.github.io/love-api
BezierCurve:rotate
BezierCurve:rotate Rotate the Bézier curve by an angle. BezierCurve:rotate( angle, ox, oy ) angle number Rotation angle in radians. ox (0) number X coordinate of the rotation center. oy (0) number Y coordinate of the rotation center.
love2d-community.github.io/love-api
BezierCurve:scale
BezierCurve:scale Scale the Bézier curve by a factor. BezierCurve:scale( s, ox, oy ) s number Scale factor. ox (0) number X coordinate of the scaling center. oy (0) number Y coordinate of the scaling center.
love2d-community.github.io/love-api
BezierCurve:setControlPoint
BezierCurve:setControlPoint Set coordinates of the i-th control point. Indices start with 1. BezierCurve:setControlPoint( i, x, y ) i number Index of the control point. x number Position of the control point along the x axis. y number Position of the control point along the y axis.
love2d-community.github.io/love-api
BezierCurve:translate
BezierCurve:translate Move the Bézier curve by an offset. BezierCurve:translate( dx, dy ) dx number Offset along the x axis. dy number Offset along the y axis.
love2d-community.github.io/love-api
RandomGenerator:getSeed
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...
love2d-community.github.io/love-api
RandomGenerator:getState
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, whe...
love2d-community.github.io/love-api
RandomGenerator:random
RandomGenerator:random Generates a pseudo-random number in a platform independent manner. number = RandomGenerator:random() number number The pseudo-random number. number = RandomGenerator:random( max ) max number The maximum possible value it should return. number number The pseudo-random integer number. number = Rand...
love2d-community.github.io/love-api
RandomGenerator:randomNormal
RandomGenerator:randomNormal Get a normally distributed pseudo random number. number = RandomGenerator:randomNormal( stddev, mean ) stddev (1) number Standard deviation of the distribution. mean (0) number The mean of the distribution. number number Normally distributed random number with variance (stddev)² and the spe...
love2d-community.github.io/love-api
RandomGenerator:setSeed
RandomGenerator:setSeed Sets the seed of the random number generator using the specified integer number. RandomGenerator:setSeed( seed ) seed number The integer number with which you want to seed the randomization. Must be within the range of 2^53. RandomGenerator:setSeed( low, high ) low number The lower 32 bits of th...
love2d-community.github.io/love-api
RandomGenerator:setState
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 setSta...
love2d-community.github.io/love-api
Transform:apply
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 ) other Transform The other Transform object to appl...
love2d-community.github.io/love-api
Transform:clone
Transform:clone Creates a new copy of this Transform. clone = Transform:clone() clone Transform The copy of this Transform.
love2d-community.github.io/love-api
Transform:getMatrix
Transform:getMatrix Gets the internal 4x4 transformation matrix stored by this Transform. The matrix is returned in row-major order. e1_1, e1_2, e1_3, e1_4, e2_1, e2_2, e2_3, e2_4, e3_1, e3_2, e3_3, e3_4, e4_1, e4_2, e4_3, e4_4 = Transform:getMatrix() e1_1 number The first column of the first row of the matrix. e1_2 nu...
love2d-community.github.io/love-api
Transform:inverse
Transform:inverse Creates a new Transform containing the inverse of this Transform. inverse = Transform:inverse() inverse Transform A new Transform object representing the inverse of this Transform's matrix.
love2d-community.github.io/love-api
Transform:inverseTransformPoint
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 glob...
love2d-community.github.io/love-api
Transform:isAffine2DTransform
Transform:isAffine2DTransform Checks whether the Transform is an affine transformation. affine = Transform:isAffine2DTransform() affine boolean true if the transform object is an affine transformation, false otherwise.
love2d-community.github.io/love-api
Transform:reset
Transform:reset Resets the Transform to an identity state. All previously applied transformations are erased. transform = Transform:reset() transform Transform The Transform object the method was called on. Allows easily chaining Transform methods.
love2d-community.github.io/love-api
Transform:rotate
Transform:rotate Applies a rotation to the Transform's coordinate system. This method does not reset any previously applied transformations. transform = Transform:rotate( angle ) angle number The relative angle in radians to rotate this Transform by. transform Transform The Transform object the method was called on. Al...
love2d-community.github.io/love-api
Transform:scale
Transform:scale Scales the Transform's coordinate system. This method does not reset any previously applied transformations. transform = Transform:scale( sx, sy ) sx number The relative scale factor along the x-axis. sy (sx) number The relative scale factor along the y-axis. transform Transform The Transform object the...
love2d-community.github.io/love-api
Transform:setMatrix
Transform:setMatrix Directly sets the Transform's internal 4x4 transformation matrix. transform = Transform:setMatrix( e1_1, e1_2, e1_3, e1_4, e2_1, e2_2, e2_3, e2_4, e3_1, e3_2, e3_3, e3_4, e4_1, e4_2, e4_3, e4_4 ) e1_1 number The first column of the first row of the matrix. e1_2 number The second column of the first ...
love2d-community.github.io/love-api
Transform:setTransformation
Transform:setTransformation Resets the Transform to the specified transformation parameters. transform = Transform:setTransformation( x, y, angle, sx, sy, ox, oy, kx, ky ) x number The position of the Transform on the x-axis. y number The position of the Transform on the y-axis. angle (0) number The orientation of the ...
love2d-community.github.io/love-api
Transform:shear
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 ) kx number The shear factor along the x-axis. ky number The shear factor along the y-axis. transform Transform The Transform object ...
love2d-community.github.io/love-api
Transform:transformPoint
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 ) globalX number The x component of the pos...
love2d-community.github.io/love-api
Transform:translate
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 ) dx number The relative translation along the x-axis. dy number The relative translation along the y-axis. transform Transform The T...
love2d-community.github.io/love-api
love.mouse.getCursor
love.mouse.getCursor Gets the current Cursor. cursor = love.mouse.getCursor() cursor Cursor The current cursor, or nil if no cursor is set.
love2d-community.github.io/love-api
love.mouse.getPosition
love.mouse.getPosition Returns the current position of the mouse. x, y = love.mouse.getPosition() x number The position of the mouse along the x-axis. y number The position of the mouse along the y-axis.
love2d-community.github.io/love-api
love.mouse.getRelativeMode
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 get...
love2d-community.github.io/love-api
love.mouse.getSystemCursor
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 i...
love2d-community.github.io/love-api
love.mouse.getX
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.
love2d-community.github.io/love-api
love.mouse.getY
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.
love2d-community.github.io/love-api
love.mouse.isCursorSupported
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 function...
love2d-community.github.io/love-api
love.mouse.isDown
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 prim...
love2d-community.github.io/love-api
love.mouse.isGrabbed
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.
love2d-community.github.io/love-api
love.mouse.isVisible
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.
love2d-community.github.io/love-api
love.mouse.newCursor
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 m...
love2d-community.github.io/love-api
love.mouse.setCursor
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()
love2d-community.github.io/love-api
love.mouse.setGrabbed
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.
love2d-community.github.io/love-api
love.mouse.setPosition
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.
love2d-community.github.io/love-api
love.mouse.setRelativeMode
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 g...
love2d-community.github.io/love-api
love.mouse.setVisible
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.
love2d-community.github.io/love-api
love.mouse.setX
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.
love2d-community.github.io/love-api
love.mouse.setY
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.
love2d-community.github.io/love-api
Cursor:getType
Cursor:getType Gets the type of the Cursor. ctype = Cursor:getType() ctype CursorType The type of the Cursor.
love2d-community.github.io/love-api
love.physics.getDistance
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 o...
love2d-community.github.io/love-api
love.physics.getMeter
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 impo...
love2d-community.github.io/love-api
love.physics.newBody
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 dyn...
love2d-community.github.io/love-api
love.physics.newChainShape
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 n...
love2d-community.github.io/love-api
love.physics.newCircleShape
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 Th...
love2d-community.github.io/love-api
love.physics.newDistanceJoint
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...
love2d-community.github.io/love-api