Difference between revisions of "love (Italiano)"
Rick astley (talk | contribs) (Created page with "Quando si inizia a sviluppare giochi con LÖVE, il primo passo è prendere confidenza con le callback fondamentali: love.load per preparare il gioco, love.update per g...") |
Rick astley (talk | contribs) (→Other Languages) |
||
Line 161: | Line 161: | ||
{{#set:Since=000}} | {{#set:Since=000}} | ||
− | == | + | == In altre lingue == |
{{i18n|love}} | {{i18n|love}} |
Revision as of 10:16, 15 March 2021
Quando si inizia a sviluppare giochi con LÖVE, il primo passo è prendere confidenza con le callback fondamentali: love.load per preparare il gioco, love.update per gestire cosa succede ad ogni frame, e love.draw che riporta sullo schermo l'aspetto grafico.
Giochi più interattivi richiederanno l'uso di altre callback, ad esempio quelle per ricervere l'input dell'utente o riguardanti altri aspetti di un gioco completo. Queste callback sono elencate più avanti.
LÖVE fornisce degli scheletri per ognuna di queste callback, che puoi riempire come preferisci all'interno del tuo codice. Tutto ciò che devi fare, è definire una funzione con un nome identico alla callback in questo modo:
-- Impostiamo dei valori default per il nostro rettangolo.
function love.load()
x, y, w, h = 20, 20, 60, 20
end
-- Incrementiamo le dimensioni del rettangolo ad ogni frame.
function love.update(dt)
w = w + 1
h = h + 1
end
-- Disegnamo il rettangolo, dandogli un colore a piacere.
function love.draw()
-- Nelle versioni precedenti alla 11.0, i valori del colore sono (0, 102, 102)
love.graphics.setColor(0, 0.4, 0.4)
love.graphics.rectangle("fill", x, y, w, h)
end
Contents
Moduli
love.audio | Provides of audio interface for playback/recording sound. | ||
love.data | Provides functionality for creating and transforming data. | 11.0 | |
love.event | Manages events, like keypresses. | 0.6.0 | |
love.filesystem | Provides an interface to the user's filesystem. | ||
love.font | Allows you to work with fonts. | 0.7.0 | |
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. | 0.5.0 | |
love.keyboard | Provides an interface to the user's keyboard. | ||
love.math | Provides system-independent mathematical functions. | 0.9.0 | |
love.mouse | Provides an interface to the user's mouse. | ||
love.physics | Can simulate 2D rigid body physics in a realistic manner. | 0.4.0 | |
love.sound | This module is responsible for decoding sound files. | ||
love.system | Provides access to information about the user's system. | 0.9.0 | |
love.thread | Allows you to work with threads. | 0.7.0 | |
love.timer | Provides high-resolution timing functionality. | ||
love.touch | Provides an interface to touch-screen presses. | 0.10.0 | |
love.video | This module is responsible for decoding and streaming video files. | 0.10.0 | |
love.window | Provides an interface for the program's window. | 0.9.0 |
Moduli di terze parti
lua-enet | Multiplayer networking module for games. | 0.9.0 | |
socket | Module for HTTP, TCP, and UDP networking. | 0.5.0 | |
utf8 | Provides basic support for manipulating UTF-8 strings. | 0.9.2 |
Funzioni
love.getVersion | Gets the current running version of LÖVE. | 0.9.1 | |
love.hasDeprecationOutput | Gets whether LÖVE displays warnings when using deprecated functionality. | 11.0 | |
love.isVersionCompatible | Gets whether the given version is compatible with the current running version of LÖVE. | 0.10.0 | |
love.setDeprecationOutput | Sets whether LÖVE displays warnings when using deprecated functionality. | 11.0 |
Tipi
Data | The superclass of all data. | ||
Object | The superclass of all LÖVE types. | ||
Variant | The types supported by love.thread and love.event. |
Callback
Tutte le callback vengono chiamate solo nel thread principale.
Generali
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. | 11.0 | |
love.errorhandler | The error handler, used to display error messages. | 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. | 0.10.0 | |
love.quit | Callback function triggered when the game is closed. | 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. | 0.9.0 | |
love.update | Callback function used to update the state of the game every frame. |
Finestra
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.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.mousefocus | Callback function triggered when window receives or loses mouse focus. | 0.9.0 | |
love.resize | Called when the window is resized. | 0.9.0 | |
love.visible | Callback function triggered when window is shown or hidden. | 0.9.0 |
Tastiera
love.keypressed | Callback function triggered when a key is pressed. | ||
love.keyreleased | Callback function triggered when a keyboard key is released. | ||
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 |
Mouse
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.wheelmoved | Callback function triggered when the mouse wheel is moved. | 0.10.0 |
Joystick
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 |
Touch
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 |
In altre lingue
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