Skip to content

Commit

Permalink
Merge branch 'release/0.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rm-code committed Jan 1, 2016
2 parents 7513fb7 + 654c2df commit 8b58ff1
Show file tree
Hide file tree
Showing 114 changed files with 19,050 additions and 15,947 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#LÖVE-API

The complete API documentation of [LÖVE](https://love2d.org/) contained in a lua table.

The project was originally started by [Santos](https://www.love2d.org/forums/memberlist.php?mode=viewprofile&u=3835) who did a majority of the work. He gave his [permission](https://www.love2d.org/forums/viewtopic.php?f=3&t=1796&start=60#p166919) to host the project online.

The API information is updated manually based on the [LÖVE-Wiki](https://love2d.org/wiki). Therefore there is no guarantee that everything is correct and up to date. If you find any errors, outdated information or missing content, please file a [bug report](https://github.com/rm-code/love-api/issues) or create a [pull request](https://github.com/rm-code/love-api/pulls).

Contributions are more than welcome!

# Versions
- The master branch currently contains the most recent documentation for LÖVE [0.9.2](https://love2d.org/wiki/0.9.2)
- The develop branch contains the most recent documentation, is constantly updated and currently moves towards LÖVE [0.10.0](https://love2d.org/wiki/0.10.0)

## Projects using the LÖVE-API

- [ZeroBrane Studio](http://studio.zerobrane.com/) - A lightweight Lua IDE
- [LÖVE Atom](https://atom.io/packages/love-atom) - Snippets and autocompletion for [Atom](https://atom.io/)
- [LÖVE Hints](https://gitlab.com/sdonalcreative/brackets-love-hints/) - Snippets, code hints and autocompletion for [Brackets](http://brackets.io/)
- [LÖVE-IDEA](https://github.com/rm-code/love-IDEA-plugin) - Snippets and code completion for [IntelliJ IDEA](https://www.jetbrains.com/idea/)
9 changes: 0 additions & 9 deletions Readme.md

This file was deleted.

257 changes: 231 additions & 26 deletions love_api.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local path = (...):match('(.-)[^%.]+$')

return {
functions = {
{
Expand Down Expand Up @@ -32,21 +34,23 @@ return {
}
},
modules = {
require('modules.Audio'),
require('modules.Event'),
require('modules.Filesystem'),
require('modules.Graphics'),
require('modules.Image'),
require('modules.Joystick'),
require('modules.Keyboard'),
require('modules.Math'),
require('modules.Mouse'),
require('modules.Physics'),
require('modules.Sound'),
require('modules.System'),
require('modules.Thread'),
require('modules.Timer'),
require('modules.Window'),
require(path .. 'modules.audio.Audio'),
require(path .. 'modules.event.Event'),
require(path .. 'modules.filesystem.Filesystem'),
require(path .. 'modules.graphics.Graphics'),
require(path .. 'modules.image.Image'),
require(path .. 'modules.joystick.Joystick'),
require(path .. 'modules.keyboard.Keyboard'),
require(path .. 'modules.math.Math'),
require(path .. 'modules.mouse.Mouse'),
require(path .. 'modules.physics.Physics'),
require(path .. 'modules.sound.Sound'),
require(path .. 'modules.system.System'),
require(path .. 'modules.thread.Thread'),
require(path .. 'modules.timer.Timer'),
require(path .. 'modules.touch.Touch'),
require(path .. 'modules.video.Video'),
require(path .. 'modules.window.Window')
},
types = {
{
Expand Down Expand Up @@ -155,6 +159,21 @@ return {
}
},
callbacks = {
{
name = 'directorydropped',
description = 'Callback function triggered when a directory is dragged and dropped onto the window.',
variants = {
{
arguments = {
{
type = 'string',
name = 'path',
description = 'The 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.'
}
}
}
}
},
{
name = 'draw',
description = 'Callback function used to draw on the screen every frame.',
Expand All @@ -177,6 +196,21 @@ return {
}
}
},
{
name = 'filedropped',
description = 'Callback function triggered when a file is dragged and dropped onto the window.',
variants = {
{
arguments = {
{
type = 'File',
name = 'file',
description = 'The unopened File object representing the file that was dropped.'
}
}
}
}
},
{
name = 'focus',
description = 'Callback function triggered when window receives or loses focus.',
Expand Down Expand Up @@ -374,7 +408,7 @@ return {
},
{
name = 'keypressed',
description = 'Callback function triggered when a key is pressed.\n\nKey repeat needs to be enabled with love.keyboard.setKeyRepeat for repeat keypress events to be received.',
description = 'Callback function triggered when a key is pressed.',
variants = {
{
arguments = {
Expand All @@ -383,6 +417,11 @@ return {
name = 'key',
description = 'Character of the key pressed.'
},
{
type = 'Scancode',
name = 'scancode',
description = 'The scancode representing the key that was pressed.'
},
{
type = 'boolean',
name = 'isrepeat',
Expand All @@ -394,7 +433,7 @@ return {
},
{
name = 'keyreleased',
description = 'Callback function triggered when a key is released.',
description = 'Callback function triggered when a keyboard key is released.',
variants = {
{
arguments = {
Expand All @@ -404,6 +443,20 @@ return {
description = 'Character of the key released.'
}
}
},
{
arguments = {
{
type = 'KeyConstant',
name = 'key',
description = 'Character of the key released.'
},
{
type = 'Scancode',
name = 'scancode',
description = 'The scancode representing the key that was released.'
}
}
}
}
},
Expand All @@ -422,6 +475,13 @@ return {
}
}
},
{
name = 'lowmemory',
description = 'Callback function triggered when the system is running out of memory on mobile devices.\n\n 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 most memory.',
variants = {
{}
}
},
{
name = 'mousefocus',
description = 'Callback function triggered when window receives or loses mouse focus.',
Expand Down Expand Up @@ -476,17 +536,22 @@ return {
{
type = 'number',
name = 'x',
description = 'Mouse x position.'
description = 'Mouse x position, in pixels.'
},
{
type = 'number',
name = 'y',
description = 'Mouse y position.'
description = 'Mouse y position, in pixels.'
},
{
type = 'MouseConstant',
type = 'number',
name = 'button',
description = 'Mouse button pressed.'
description = 'The button index that was pressed. 1 is the primary button (usually left-click), 2 is the secondary button, etc.'
},
{
type = 'boolean',
name = 'isTouch',
description = 'True if the mouse button press originated from a touchscreen touch-press.'
}
}
}
Expand All @@ -501,17 +566,22 @@ return {
{
type = 'number',
name = 'x',
description = 'Mouse x position.'
description = 'Mouse x position, in pixels.'
},
{
type = 'number',
name = 'y',
description = 'Mouse y position.'
description = 'Mouse y position, in pixels.'
},
{
type = 'MouseConstant',
type = 'number',
name = 'button',
description = 'Mouse button released.'
description = 'The button index that was released. 1 is the primary button (usually left-click), 2 is the secondary button, etc.'
},
{
type = 'boolean',
name = 'isTouch',
description = 'True if the mouse button press originated from a touchscreen touch-release.'
}
}
}
Expand Down Expand Up @@ -559,6 +629,31 @@ return {
{}
}
},
{
name = 'textedited',
description = 'Called when the candidate text for an IME (Input Method Editor) has changed.\n\nThe candidate text is not the final text that the user will eventually choose. Use love.textinput for that.',
variants = {
{
arguments = {
{
type = 'string',
name = 'text',
description = 'The UTF-8 encoded unicode candidate text.'
},
{
type = 'number',
name = 'start',
description = 'The start cursor of the selected candidate text.'
},
{
type = 'number',
name = 'length',
description = 'The length of the selected candidate text. May be 0.'
}
}
}
}
},
{
name = 'textinput',
description = '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.',
Expand Down Expand Up @@ -594,6 +689,96 @@ return {
}
}
},
{
name = 'touchmoved',
description = 'Callback function triggered when a touch press moves inside the touch screen.',
variants = {
{
arguments = {
{
type = 'light userdata',
name = 'id',
description = 'The identifier for the touch press.'
},
{
type = 'number',
name = 'x',
description = 'The x-axis position of the touch press inside the window, in pixels.'
},
{
type = 'number',
name = 'y',
description = 'The y-axis position of the touch press inside the window, in pixels.'
},
{
type = 'number',
name = 'pressure',
description = 'The amount of pressure being applied. Most touch screens aren\'t pressure sensitive, in which case the pressure will be 1.'
}
}
}
}
},
{
name = 'touchpressed',
description = 'Callback function triggered when the touch screen is touched.',
variants = {
{
arguments = {
{
type = 'light userdata',
name = 'id',
description = 'The identifier for the touch press.'
},
{
type = 'number',
name = 'x',
description = 'The x-axis position of the touch press inside the window, in pixels.'
},
{
type = 'number',
name = 'y',
description = 'The y-axis position of the touch press inside the window, in pixels.'
},
{
type = 'number',
name = 'pressure',
description = 'The amount of pressure being applied. Most touch screens aren\'t pressure sensitive, in which case the pressure will be 1.'
}
}
}
}
},
{
name = 'touchreleased',
description = 'Callback function triggered when the touch screen stops being touched.',
variants = {
{
arguments = {
{
type = 'light userdata',
name = 'id',
description = 'The identifier for the touch press.'
},
{
type = 'number',
name = 'x',
description = 'The x-axis position of the touch press inside the window, in pixels.'
},
{
type = 'number',
name = 'y',
description = 'The y-axis position of the touch press inside the window, in pixels.'
},
{
type = 'number',
name = 'pressure',
description = 'The amount of pressure being applied. Most touch screens aren\'t pressure sensitive, in which case the pressure will be 1.'
}
}
}
}
},
{
name = 'update',
description = 'Callback function triggered when a key is pressed.',
Expand Down Expand Up @@ -623,6 +808,26 @@ return {
}
}
}
},
{
name = 'wheelmoved',
description = 'Callback function triggered when the mouse wheel is moved.',
variants = {
{
arguments = {
{
type = 'number',
name = 'x',
description = 'Amount of horizontal mouse wheel movement. Positive values indicate movement to the right.'
},
{
type = 'number',
name = 'y',
description = 'Amount of vertical mouse wheel movement. Positive values indicate upward movement.'
}
}
}
}
}
}
}
}
Loading

0 comments on commit 8b58ff1

Please sign in to comment.