love (Français)

C'est le module racine qui contient tous les autres modules. Le plus löve des modules...

Quand on commence à scripter 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 status 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

Config FilesGame configuration settings.
love.audiodisconnectedCalled when the active audio device is disconnected.
love.directorydroppedCallback function triggered when a directory is dragged and dropped onto the window.
love.displayrotatedCalled when the device display orientation changed.
love.drawCallback function used to draw on the screen every frame.
love.errhandThe error handler, used to display error messages.
love.errorhandlerThe error handler, used to display error messages.
love.filedroppedCallback function triggered when a file is dragged and dropped onto the window.
love.focusCallback function triggered when window receives or loses focus.
love.gamepadaxisCalled when a Joystick's virtual gamepad axis is moved.
love.gamepadpressedCalled when a Joystick's virtual gamepad button is pressed.
love.gamepadreleasedCalled when a Joystick's virtual gamepad button is released.
love.joystickaddedCalled when a Joystick is connected.
love.joystickaxisCalled when a joystick axis moves.
love.joystickhatCalled when a joystick hat direction changes.
love.joystickpressedCalled when a joystick button is pressed.
love.joystickreleasedCalled when a joystick button is released.
love.joystickremovedCalled when a Joystick is disconnected.
love.joysticksensorupdatedCalled when a Joystick's sensor is updated with new values.
love.keypressedCallback function triggered when a key is pressed.
love.keyreleasedCallback function triggered when a keyboard key is released.
love.loadThis function is called exactly once at the beginning of the game.
love.localechangedCallback function triggered when the user's system locale preferences have changed.
love.lowmemoryCallback function triggered when the system is running out of memory on mobile devices.
love.mousefocusCallback function triggered when window receives or loses mouse focus.
love.mousemovedCallback function triggered when the mouse is moved.
love.mousepressedCallback function triggered when a mouse button is pressed.
love.mousereleasedCallback function triggered when a mouse button is released.
love.quitCallback function triggered when the game is closed.
love.resizeCalled when the window is resized.
love.runThe main function, containing the main loop. A sensible default is used when left out.
love.sensorupdatedCalled when the in-device sensor is updated.
love.texteditedCalled when the candidate text for an IME has changed.
love.textinputCalled when text has been entered by the user.
love.threaderrorCallback function triggered when a Thread encounters an error.
love.touchmovedCallback function triggered when a touch press moves inside the touch screen.
love.touchpressedCallback function triggered when the touch screen is touched.
love.touchreleasedCallback function triggered when the touch screen stops being touched.
love.updateCallback function used to update the state of the game every frame.
love.visibleCallback function triggered when window is shown or hidden.
love.wheelmovedCallback function triggered when the mouse wheel is moved.

Autres langues