Difference between revisions of "love (Français)"

Line 31: Line 31:
 
== Fonctions de Rappel ==
 
== Fonctions de Rappel ==
 
=== Géneral ===
 
=== Géneral ===
{{#ask: [[Category:Callbacks]] [[Subcategory::General]] [[parent::love (Français)]] OR [[Category:Callbacks]] [[parent::love]] [[Concept:Current]]
+
{{#ask: [[Category:Callbacks]] [[Subcategory::General]] [[parent::love (Français)]] OR [[Category:Callbacks]] [[parent::love]] [[Subcategory::General]][[Concept:Current]]
 
| headers=hide
 
| headers=hide
 
| format=template
 
| format=template
Line 42: Line 42:
 
}}
 
}}
 
=== Joystick ===
 
=== Joystick ===
{{#ask: [[Category:Callbacks]] [[Subcategory::Joystick]] [[parent::love (Français)]] OR [[Category:Callbacks]] [[parent::love]] [[Concept:Current]]
+
{{#ask: [[Category:Callbacks]] [[Subcategory::Joystick]] [[parent::love (Français)]] OR [[Category:Callbacks]] [[parent::love]] [[Subcategory::General]][[Concept:Current]]
 
| headers=hide
 
| headers=hide
 
| format=template
 
| format=template

Revision as of 10:59, 15 December 2018

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.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. Added since 11.0
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. Added since 0.10.0
love.quit Callback function triggered when the game is closed. Added since 0.7.0
love.run The main function, containing the main loop. A sensible default is used when left out.
love.threaderror Callback function triggered when a Thread encounters an error. Added since 0.9.0
love.update Callback function used to update the state of the game every frame.

Joystick

Config Files Game configuration settings.
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. Added since 11.0
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. Added since 0.10.0
love.quit Callback function triggered when the game is closed. Added since 0.7.0
love.run The main function, containing the main loop. A sensible default is used when left out.
love.threaderror Callback function triggered when a Thread encounters an error. Added since 0.9.0
love.update Callback function used to update the state of the game every frame.


Autres langues