love (Français)
C'est le module racine qui contient tous les autres modules. Le plus löve des modules...
Quand on commence à programmer avec LÖVE, la partie la plus importante est celle des «Call Backs», love.load pour charger les paramètres initiaux, love.update pour gérer le statut du jeu entre chaque «frame» et, love.draw pour appliquer des dessins à l'écran.
La plupart des jeux interactifs réécrivent certains callbacks pour gérer les actions de l'utilisateur ainsi que tout les aspects d'un jeu complet.
LÖVE dispose de remplacements par défaut pour ces callbacks que vous pouvez simplement réécrire dans votre propre code, simplement en spécifiant leur nom complet:
function love.load()
hamster = love.graphics.newImage("hamster.png")
x = 50
y = 50
end
function love.draw()
love.graphics.draw(hamster, x, y)
end
Modules
Types
Fonctions de Rappel
Géneral
Config Files | Game configuration settings. | ||
love.directorydropped | Callback function triggered when a directory is dragged and dropped onto the window. | 0.10.0 | |
love.displayrotated | Called when the device display orientation changed. | 11.3 | |
love.draw | Callback function used to draw on the screen every frame. | ||
love.errhand | The error handler, used to display error messages. | ||
love.errorhandler | The error handler, used to display error messages. | 11.0 | |
love.filedropped | Callback function triggered when a file is dragged and dropped onto the window. | 0.10.0 | |
love.focus | Callback function triggered when window receives or loses focus. | 0.7.0 | |
love.gamepadaxis | Called when a Joystick's virtual gamepad axis is moved. | 0.9.0 | |
love.gamepadpressed | Called when a Joystick's virtual gamepad button is pressed. | 0.9.0 | |
love.gamepadreleased | Called when a Joystick's virtual gamepad button is released. | 0.9.0 | |
love.joystickadded | Called when a Joystick is connected. | 0.9.0 | |
love.joystickaxis | Called when a joystick axis moves. | 0.9.0 | |
love.joystickhat | Called when a joystick hat direction changes. | 0.9.0 | |
love.joystickpressed | Called when a joystick button is pressed. | ||
love.joystickreleased | Called when a joystick button is released. | ||
love.joystickremoved | Called when a Joystick is disconnected. | 0.9.0 | |
love.keypressed | Callback function triggered when a key is pressed. | ||
love.keyreleased | Callback function triggered when a keyboard key is released. | ||
love.load | This function is called exactly once at the beginning of the game. | ||
love.lowmemory | Callback function triggered when the system is running out of memory on mobile devices. | 0.10.0 | |
love.mousefocus | Callback function triggered when window receives or loses mouse focus. | 0.9.0 | |
love.mousemoved | Callback function triggered when the mouse is moved. | 0.9.2 | |
love.mousepressed | Callback function triggered when a mouse button is pressed. | ||
love.mousereleased | Callback function triggered when a mouse button is released. | ||
love.quit | Callback function triggered when the game is closed. | 0.7.0 | |
love.resize | Called when the window is resized. | 0.9.0 | |
love.run | The main function, containing the main loop. A sensible default is used when left out. | ||
love.textedited | Called when the candidate text for an IME has changed. | 0.10.0 | |
love.textinput | Called when text has been entered by the user. | 0.9.0 | |
love.threaderror | Callback function triggered when a Thread encounters an error. | 0.9.0 | |
love.touchmoved | Callback function triggered when a touch press moves inside the touch screen. | 0.10.0 | |
love.touchpressed | Callback function triggered when the touch screen is touched. | 0.10.0 | |
love.touchreleased | Callback function triggered when the touch screen stops being touched. | 0.10.0 | |
love.update | Callback function used to update the state of the game every frame. | ||
love.visible | Callback function triggered when window is shown or hidden. | 0.9.0 | |
love.wheelmoved | Callback function triggered when the mouse wheel is moved. | 0.10.0 |
Joystick
Config Files | Game configuration settings. | ||
love.directorydropped | Callback function triggered when a directory is dragged and dropped onto the window. | 0.10.0 | |
love.displayrotated | Called when the device display orientation changed. | 11.3 | |
love.draw | Callback function used to draw on the screen every frame. | ||
love.errhand | The error handler, used to display error messages. | ||
love.errorhandler | The error handler, used to display error messages. | 11.0 | |
love.filedropped | Callback function triggered when a file is dragged and dropped onto the window. | 0.10.0 | |
love.focus | Callback function triggered when window receives or loses focus. | 0.7.0 | |
love.gamepadaxis | Called when a Joystick's virtual gamepad axis is moved. | 0.9.0 | |
love.gamepadpressed | Called when a Joystick's virtual gamepad button is pressed. | 0.9.0 | |
love.gamepadreleased | Called when a Joystick's virtual gamepad button is released. | 0.9.0 | |
love.joystickadded | Called when a Joystick is connected. | 0.9.0 | |
love.joystickaxis | Called when a joystick axis moves. | 0.9.0 | |
love.joystickhat | Called when a joystick hat direction changes. | 0.9.0 | |
love.joystickpressed | Called when a joystick button is pressed. | ||
love.joystickreleased | Called when a joystick button is released. | ||
love.joystickremoved | Called when a Joystick is disconnected. | 0.9.0 | |
love.keypressed | Callback function triggered when a key is pressed. | ||
love.keyreleased | Callback function triggered when a keyboard key is released. | ||
love.load | This function is called exactly once at the beginning of the game. | ||
love.lowmemory | Callback function triggered when the system is running out of memory on mobile devices. | 0.10.0 | |
love.mousefocus | Callback function triggered when window receives or loses mouse focus. | 0.9.0 | |
love.mousemoved | Callback function triggered when the mouse is moved. | 0.9.2 | |
love.mousepressed | Callback function triggered when a mouse button is pressed. | ||
love.mousereleased | Callback function triggered when a mouse button is released. | ||
love.quit | Callback function triggered when the game is closed. | 0.7.0 | |
love.resize | Called when the window is resized. | 0.9.0 | |
love.run | The main function, containing the main loop. A sensible default is used when left out. | ||
love.textedited | Called when the candidate text for an IME has changed. | 0.10.0 | |
love.textinput | Called when text has been entered by the user. | 0.9.0 | |
love.threaderror | Callback function triggered when a Thread encounters an error. | 0.9.0 | |
love.touchmoved | Callback function triggered when a touch press moves inside the touch screen. | 0.10.0 | |
love.touchpressed | Callback function triggered when the touch screen is touched. | 0.10.0 | |
love.touchreleased | Callback function triggered when the touch screen stops being touched. | 0.10.0 | |
love.update | Callback function used to update the state of the game every frame. | ||
love.visible | Callback function triggered when window is shown or hidden. | 0.9.0 | |
love.wheelmoved | Callback function triggered when the mouse wheel is moved. | 0.10.0 |
Autres langues
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info