love.keyboard.setTextInput

love.keyboard.setTextInput Available since LÖVE 0.9.0 This function is not supported in earlier versions. Enables or disables text input events. It is enabled by default on Windows, Mac, and Linux, and disabled by default on iOS and Android. Function Synopsis love.keyboard.setTextInput( enable ) Arguments boolean enable Whether text input events should be enabled. Returns Nothing. Function Available since LÖVE 0.10.0 This variant is not supported in earlier versions. Synopsis love.

love.keypressed

love.keypressed Callback function triggered when a key is pressed. Function Available since LÖVE 0.10.0 This variant is not supported in earlier versions. Synopsis love.keypressed( key, scancode, isrepeat ) Arguments KeyConstant key Character of the pressed key. Scancode scancode The scancode representing the pressed key. boolean isrepeat Whether this keypress event is a repeat. The delay between key repeats depends on the user's system settings. Returns Nothing. Notes Scancodes are

love.keyreleased

love.keyreleased Callback function triggered when a keyboard key is released. Function Available since LÖVE 0.10.0 This variant is not supported in earlier versions. Synopsis love.keyreleased( key, scancode ) Arguments KeyConstant key Character of the released key. Scancode scancode The scancode representing the released key. Returns Nothing. Notes Scancodes are keyboard layout-independent, so the scancode "w" will be used if the key in the same place as the "w" key on an American key

love.load

love.load This function is called exactly once at the beginning of the game. Function Synopsis love.load( arg ) Arguments table arg Command line arguments given to the game. Returns Nothing. Examples Establish some variables/resources on the game load, so that they can be used repeatedly in other functions (such as love.draw). function love.load() hamster = love.graphics.newImage("hamster.png") x = 50 y = 50 end   function love.draw() love.graphics.draw(hamster, x, y) end See

love.lowmemory

love.lowmemory Available since LÖVE 0.10.0 This function is not supported in earlier versions. 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, and calling collectgarbage()), when this event is triggered. Sounds and images in particular tend to use the m

love.math.compress

love.math.compress Available since LÖVE 0.10.0 This function is not supported in earlier versions. Compresses a string or data using a specific compression algorithm. This function, depending on the compression format and level, can be slow if called repeatedly, such as from love.update or love.draw. Some benchmarks are available here. Function Synopsis compressedData = love.math.compress( rawstring, format, level ) Arguments string rawstring The raw (un-compressed) string to compress. C

love.math.decompress

love.math.decompress Available since LÖVE 0.10.0 This function is not supported in earlier versions. Decompresses a CompressedData or previously compressed string or Data object. Function Synopsis rawstring = love.math.decompress( compressedData ) Arguments CompressedData compressedData The compressed data to decompress. Returns string rawstring A string containing the raw decompressed data. Function Synopsis rawstring = love.math.decompress( compressedString, format ) Arguments stri

love.math.gammaToLinear

love.math.gammaToLinear Available since LÖVE 0.9.1 This function is not supported in earlier versions. 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. Gamma-correct rendering is an advanced topic and it's easy to get color-spaces mixed up. If you're not sur

love.math.getRandomSeed

love.math.getRandomSeed Available since LÖVE 0.9.0 This function is not supported in earlier versions. 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. Function Synopsis low, high = love.math.getRandomSeed( ) Arguments None. Returns number low Integer number representing the lower 32 bits of the

love.math.isConvex

love.math.isConvex Available since LÖVE 0.9.0 This function is not supported in earlier versions. 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. Function Synopsis convex = love.math.isConvex( vertices ) Arguments table vertices The vertices of the polygon as a table in the form of {x1, y1, x2, y2, x3, y3, ...}. Returns boolean convex Whether the given polygon is conv