love (Română)
Când începi să scrii jocuri folosind LÖVE, cele mai importante părți ale API-ului sunt funcțiile callback: love.load pentru a face inițializarea jocului tău, love.update care e folosit pentru a administra starea jocului tău cadru-cu-cadru, și love.draw care este folosită pentru a desena starea curentă pe ecran.
Jocurile mai interactive vor suprascrie funcții callback adiționale pentru a controla intrările de la utilizator și alte aspecte ale unui joc complet.
LÖVE furnizează înlocuitori pentru aceste funcții callback, pe care le poți suprascrie înăuntrul codului tău prin crearea funcțiilor tale cu același nume ca cel al funcțiilor callback:
-- Încarcă niște valori implicite pentru dreptunghiul nostru. function love.load() x, y, w, h = 20, 20, 60, 20 end -- Incrementează mărimea dreptunghiului cu fiecare cadru. function love.update(dt) w = w + 1 h = h + 1 end -- Desenează un dreptunghi colorat. function love.draw() love.graphics.setColor(0, 100, 100) love.graphics.rectangle("fill", x, y, w, h) end
Module
love.audio | Provides an interface to output sound to the user's speakers. | ||
love.data | Provides functionality for creating and transforming data. | ![]() |
|
love.event | Manages events, like keypresses. | ![]() |
|
love.filesystem | Provides an interface to the user's filesystem. | ||
love.font | Allows you to work with fonts. | ![]() |
|
love.graphics | Drawing of shapes and images, management of screen geometry. | ||
love.image | Provides an interface to decode encoded image data. | ||
love.joystick | Provides an interface to connected joysticks. | ||
love.keyboard | Provides an interface to the user's keyboard. | ||
love.math | Provides system-independent mathematical functions. | ![]() |
|
love.mouse | Provides an interface to the user's mouse. | ||
love.physics | Can simulate 2D rigid body physics in a realistic manner. | ![]() |
|
love.sound | This module is responsible for decoding sound files. | ||
love.system | Provides access to information about the user's system. | ![]() |
|
love.thread | Allows you to work with threads. | ![]() |
|
love.timer | Provides high-resolution timing functionality. | ||
love.touch | Provides an interface to touch-screen presses. | ![]() |
|
love.video | This module is responsible for decoding and streaming video files. | ![]() |
|
love.window | Provides an interface for the program's window. | ![]() |
Module terțe
lua-enet | Multiplayer networking module for games. | ![]() |
|
socket | Module for HTTP, TCP, and UDP networking. | ![]() |
|
utf8 | Provides basic support for manipulating UTF-8 strings. | ![]() |
Funcții
love.getVersion | Gets the current running version of LÖVE. | ![]() |
|
love.hasDeprecationOutput | Gets whether LÖVE displays warnings when using deprecated functionality. | ![]() |
|
love.setDeprecationOutput | Sets whether LÖVE displays warnings when using deprecated functionality. | ![]() |
Tipuri
Data | The superclass of all data. | ||
Object | The superclass of all LÖVE types. | ||
Variant | The types supported by love.thread and love.event |
Funcții callback
General
Config Files | Game configuration settings. | ||
love.directorydropped | Callback function triggered when a directory is dragged and dropped onto the window. | ![]() |
|
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. | ![]() |
|
love.filedropped | Callback function triggered when a file is dragged and dropped onto the window. | ![]() |
|
love.focus | Callback function triggered when window receives or loses focus. | ![]() |
|
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. | ![]() |
|
love.mousefocus | Callback function triggered when window receives or loses mouse focus. | ![]() |
|
love.mousemoved | Callback function triggered when the mouse is moved. | ![]() |
|
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. | ![]() |
|
love.resize | Called when the window is resized. | ![]() |
|
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. | ![]() |
|
love.textinput | Called when text has been entered by the user. | ![]() |
|
love.threaderror | Callback function triggered when a Thread encounters an error. | ![]() |
|
love.touchmoved | Callback function triggered when a touch press moves inside the touch screen. | ![]() |
|
love.touchpressed | Callback function triggered when the touch screen is touched. | ![]() |
|
love.touchreleased | Callback function triggered when the touch screen stops being touched. | ![]() |
|
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. | ![]() |
|
love.wheelmoved | Callback function triggered when the mouse wheel is moved. | ![]() |
Joystick
love.gamepadaxis | Called when a Joystick's virtual gamepad axis is moved. | ![]() |
|
love.gamepadpressed | Called when a Joystick's virtual gamepad button is pressed. | ![]() |
|
love.gamepadreleased | Called when a Joystick's virtual gamepad button is released. | ![]() |
|
love.joystickadded | Called when a Joystick is connected. | ![]() |
|
love.joystickaxis | Called when a joystick axis moves. | ![]() |
|
love.joystickhat | Called when a joystick hat direction changes. | ![]() |
|
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. | ![]() |
Alte limbi
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