### Install LÖVE on Debian Source: https://love2d.org/wiki/Getting_Started_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29 Commands to install LÖVE on Debian Testing and Sid using aptitude or apt-get. ```bash #Debian Testing和Sid下 sudo aptitude install love #或sudo apt-get install love ``` -------------------------------- ### Install LÖVE on Ubuntu Source: https://love2d.org/wiki/Getting_Started_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29 Commands to add the LÖVE stable PPA, update package lists, and install LÖVE on Ubuntu systems. ```bash sudo add-apt-repository ppa:bartbes/love-stable sudo apt-get update sudo apt-get install love ``` -------------------------------- ### Install LÖVE on Archlinux Source: https://love2d.org/wiki/Getting_Started_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29 Command to install LÖVE on Archlinux using pacman. ```bash sudo pacman -S love ``` -------------------------------- ### Run Game on Windows (Command Line) Source: https://love2d.org/wiki/Getting_Started_%28Rom%C3%A2n%C4%83%29 Examples of how to run a LÖVE game from the command line on Windows, both from a folder and a packed .love file. ```batch "C:\Program Files\LOVE\love.exe" "C:\jocuri\jocul-meu" "C:\Program Files\LOVE\love.exe" "C:\jocuri\joc-împachetat.love" ``` -------------------------------- ### Install LÖVE on Fedora Source: https://love2d.org/wiki/Getting_Started_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29 Commands to install LÖVE on newer Fedora versions using yum or dnf. ```bash sudo yum install love #或sudo dnf install love ``` -------------------------------- ### Run LÖVE Game on Windows Source: https://love2d.org/wiki/Getting_Started_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29 Examples of how to run a LÖVE game from the command line on Windows, specifying the game directory or a .love file. ```batch "C:\Program Files\LOVE\love.exe" "C:\games\mygame" "C:\Program Files\LOVE\love.exe" "C:\games\packagedgame.love" ``` -------------------------------- ### Run LÖVE Game on Windows (Command Line) Source: https://love2d.org/wiki/Getting_Started_%28Slovensk%C3%BD%29 Examples of how to run a LÖVE game from the Windows command line, either from a game directory or a packaged .love file. Includes the --console flag to display print output. ```batch "C:\\Program Files\\LOVE\\love.exe" "C:\\games\\mygame" "C:\\Program Files\\LOVE\\love.exe" "C:\\games\\packagedgame.love" "C:\\Program Files\\LOVE\\love.exe" --console ``` -------------------------------- ### Check LÖVE Version Source: https://love2d.org/wiki/%E5%9F%BA%E7%A4%8E%E5%85%A5%E9%96%80 Command to verify the installed LÖVE framework version. ```bash love --version ``` -------------------------------- ### Execute LÖVE Game (Windows) Source: https://love2d.org/wiki/%E5%9F%BA%E7%A4%8E%E5%85%A5%E9%96%80 Examples of how to run a LÖVE game from the command line on Windows, targeting either a directory or a packaged .love file. ```batch love C:\games\mygame love C:\games\packagedgame.love ``` -------------------------------- ### Run LÖVE Game from Folder (Linux) Source: https://love2d.org/wiki/Getting_Started_%28T%C3%BCrk%C3%A7e%29 Command to run a LÖVE game located in a specified folder on Linux. Assumes LÖVE is installed and accessible from the command line. ```bash love /home/path/to/gamedir/ ``` -------------------------------- ### LÖVE API - Object-Oriented Programming Example Source: https://love2d.org/wiki/Tutorial%3AA_Guide_to_Getting_Started_with_Love2D_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29 Demonstrates Object-Oriented Programming (OOP) concepts in LÖVE using the ParticleSystem class. It shows how to create an instance of a class, access its data, modify its data, and call its methods. ```Lua -- love.graphics.newParticleSystem создаёт экземпляр класса ParticleSystem -- Теперь переменная ps содержит объект класса ParticleSystem ps = love.filesystem.newParticleSystem(image, 1000) ps:getDirection() -- получение некоторых данных, которые содержит объект ps:setDirection(0) -- установка некоторых данных объекта ps:start() -- вызов метода, который что-либо делает с данными ``` -------------------------------- ### List Getting Started (Slovenský) Source: https://love2d.org/wiki/Special%3ASearchByProperty/%3AModification-20date/28-20December-202018-2013%3A39%3A58 This entry refers to the Slovak translation of the 'Getting Started' guide for LOVE2D. The timestamp indicates its last modification. ```lua Getting Started (Slovenský) ``` -------------------------------- ### Run Game on Linux (Command Line) Source: https://love2d.org/wiki/Getting_Started_%28Rom%C3%A2n%C4%83%29 Commands to run a LÖVE game from the command line on Linux, for both directories and packed .love files. ```bash love /home/cale/spre/director-joc/ love /home/cale/spre/joc-împachetat.love ``` -------------------------------- ### Execute Game with Alias (Mac OS X) Source: https://love2d.org/wiki/No%C5%A3iuni_de_baz%C4%83 Example of how to run a LÖVE game from the command line after setting up the 'love' alias on Mac OS X. ```shell love ~/cale/spre/jocul_meu ``` -------------------------------- ### Creating .love Files on Windows Source: https://love2d.org/wiki/Tutorial%3AA_Guide_to_Getting_Started_with_Love2D_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29 This section outlines the steps to create a .love file on Windows, which is a standard way to package a Love2D game into a single file. It involves creating a ZIP archive of the game's contents, ensuring `main.lua` is at the root, and then renaming the `.zip` extension to `.love`. It also mentions the need to show file extensions in folder options. ```text 1. Create a zip archive (this feature is built into XP, Vista and 7) 2. Copy all your files into the zip archive, keeping the directory structure and ensuring that the main.lua file is in the root directory (if you create a zip archive containing a folder with all the files, it won't work) 3. Rename the file extension from .zip to .love By default, the file extension is hidden. You need to (by pressing alt), go to folder properties and uncheck "Hide extensions for known file types" to be able to rename the zip archive. ``` -------------------------------- ### Create LÖVE Game Package (Linux/OS X) Source: https://love2d.org/wiki/Tutorial%3AA_Guide_to_Getting_Started_with_Love2D_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29 This command creates a .love file from a project directory on Linux or OS X. It uses zip to archive the contents of the current directory and places the resulting .love file in the parent directory. ```Shell cd ~/Projects/EpicGame zip -r ../${PWD##*/}.love * ``` -------------------------------- ### Create 'Hello World' Game Source: https://love2d.org/wiki/Getting_Started_%28Rom%C3%A2n%C4%83%29 A minimal LÖVE game written in Lua that displays 'Hello world' on the screen. This code should be saved in a file named main.lua. ```lua function love.draw() love.graphics.print("Hello world", 400, 300) end ``` -------------------------------- ### Setting up LÖVE for iOS Project in Xcode Source: https://love2d.org/wiki/Getting_Started Steps to configure the LÖVE for iOS project in Xcode, including dependency management and target selection. ```bash love/platform/xcode/love.xcodeproj ``` -------------------------------- ### Avviare un gioco LÖVE da riga di comando (Windows) Source: https://love2d.org/wiki/Getting_Started_%28Italiano%29 Comandi per avviare un gioco LÖVE da riga di comando su Windows, sia da una cartella che da un file .love. Include anche l'opzione per collegare una console. ```batch "C:\Program Files\LOVE\love.exe" "C:\games\mygame" "C:\Program Files\LOVE\love.exe" "C:\games\packagedgame.love" "C:\Program Files\LOVE\love.exe" --console ``` -------------------------------- ### Run LÖVE Game from .love File (Windows) Source: https://love2d.org/wiki/Getting_Started_%28T%C3%BCrk%C3%A7e%29 Command to run a LÖVE game packaged as a .love file on Windows. Ensure the path to the .love file and the LÖVE executable are correct. ```batch "C:\Program Files\LOVE\love.exe" "C:\games\packagedgame.love" ``` -------------------------------- ### Create 'Hello World' Game Source: https://love2d.org/wiki/Getting_Started_%28Slovensk%C3%BD%29 Basic Lua code for a LÖVE game that displays 'Hello World' at coordinates (400, 300) on the screen. Requires the LÖVE framework to run. ```lua function love.draw () love.graphics.print ("Hello World", 400, 300) end ``` -------------------------------- ### Run LÖVE Game from Folder (Windows) Source: https://love2d.org/wiki/Getting_Started_%28T%C3%BCrk%C3%A7e%29 Command to run a LÖVE game located in a specified folder on Windows. Replace paths with your actual game folder and LÖVE executable location. ```batch "C:\Program Files\LOVE\love.exe" "C:\games\mygame" ``` -------------------------------- ### Gioco LÖVE 'Ciao mondo' Source: https://love2d.org/wiki/Getting_Started_%28Italiano%29 Codice Lua di base per un gioco LÖVE che visualizza 'Ciao mondo' nella finestra di gioco. ```lua function love.draw() love.graphics.print("Ciao mondo", 400, 300) end ``` -------------------------------- ### Run LÖVE Game from .love File (Linux) Source: https://love2d.org/wiki/Getting_Started_%28T%C3%BCrk%C3%A7e%29 Command to run a LÖVE game packaged as a .love file on Linux. This requires the LÖVE executable to be in your system's PATH. ```bash love /home/path/to/packagedgame.love ``` -------------------------------- ### Run Game on macOS (Terminal) Source: https://love2d.org/wiki/Getting_Started_%28Rom%C3%A2n%C4%83%29 Methods to run a LÖVE game on macOS from the Terminal, including using the application bundle directly for console output. ```bash open -n -a love "~/cale/spre/joc" /Applications/love.app/Contents/MacOS/love ~/cale/spre/joc ``` -------------------------------- ### Creare alias per LÖVE (Mac OS X) Source: https://love2d.org/wiki/Getting_Started_%28Italiano%29 Istruzioni per creare un alias nel file .bash_profile su Mac OS X per richiamare il binario di LÖVE più facilmente dalla riga di comando. ```bash open -a TextEdit ~/.bash_profile touch ~/.bash_profile # alias per love alias love="/Applications/love.app/Contents/MacOS/love" ``` -------------------------------- ### Avviare un gioco LÖVE da terminale (Mac OS X) Source: https://love2d.org/wiki/Getting_Started_%28Italiano%29 Comandi per avviare un gioco LÖVE da terminale su Mac OS X, sia tramite il comando 'open' che eseguendo direttamente il binario di LÖVE. ```bash open -n -a love "~/path/to/mygame" /Applications/love.app/Contents/MacOS/love ~/path/to/mygame ``` -------------------------------- ### Run LÖVE Game (macOS Terminal) Source: https://love2d.org/wiki/Getting_Started_%28T%C3%BCrk%C3%A7e%29 Command to run a LÖVE game from the macOS Terminal, assuming LÖVE is installed in the Applications directory. This method does not output print statements to the terminal. ```bash open -n -a love "~/path/to/mygame" ``` -------------------------------- ### Run LÖVE with Console on Windows Source: https://love2d.org/wiki/Getting_Started_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29 Command to launch a LÖVE application with the console window enabled on Windows, allowing for print statements to be visible. ```batch "C:\Program Files\LOVE\love.exe" --console ``` -------------------------------- ### Loading LÖVE Syntax Definition in Textastic for iOS Source: https://love2d.org/wiki/Getting_Started Instructions for loading a custom LÖVE syntax definition into the Textastic app on iOS for Lua development. ```bash mv "subllualove-master" "On my iPad/Textastic/#Textastic/" ``` ```bash Settings -> Other -> Reload Customizations File Properties -> Syntax Definition -> LOVE (*.lua) ``` -------------------------------- ### Run LÖVE Game with Terminal Output (macOS) Source: https://love2d.org/wiki/Getting_Started_%28T%C3%BCrk%C3%A7e%29 Command to execute the LÖVE binary directly within the application bundle on macOS to enable terminal output for print statements. Requires the correct path to the LÖVE application. ```bash /Applications/love.app/Contents/MacOS/love ~/path/to/mygame ``` -------------------------------- ### Create macOS Terminal Alias for LÖVE Source: https://love2d.org/wiki/Getting_Started_%28Rom%C3%A2n%C4%83%29 Lua code to add to the ~/.bash_profile file to create a terminal alias for running LÖVE games easily on macOS. ```bash # alias către love alias love="/Applications/love.app/Contents/MacOS/love" ``` -------------------------------- ### Execute LÖVE Directly (macOS) Source: https://love2d.org/wiki/Getting_Started_%28%E6%AD%A3%E9%AB%94%E4%B8%AD%E6%96%87%29 This command directly executes the LÖVE application from its macOS path, allowing you to run a game. This is an alternative to using the 'open' command. ```bash /Applications/love.app/Contents/MacOS/love mygame ``` -------------------------------- ### Run LÖVE Game from Command Line (macOS) Source: https://love2d.org/wiki/Getting_Started_%28%E6%AD%A3%E9%AB%94%E4%B8%AD%E6%96%87%29 This command executes a LÖVE game on macOS by specifying the game directory. It uses the 'open' command to launch the LÖVE application. ```bash open -n -a love "/home/path/to/game" ``` -------------------------------- ### Create Bash Profile on Mac if Non-existent Source: https://love2d.org/wiki/No%C8%9Biuni_de_baz%C4%83 This command ensures that the `.bash_profile` file exists in the user's home directory on Mac OS X. If the file doesn't exist, it creates an empty one, allowing subsequent edits. ```bash touch ~/.bash_profile ``` -------------------------------- ### macOS Terminal Alias for Love2D Source: https://love2d.org/wiki/Tutorial%3AA_Guide_to_Getting_Started_with_Love2D_%28%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9%29 This snippet shows how to set up a terminal alias on macOS to easily launch Love2D games. It requires editing the `~/.bash_profile` file and assumes the `love.app` is located in the Applications folder. This simplifies launching games by typing `love` in the terminal. ```bash alias love="/Applications/love.app/Contents/MacOS/love" ``` -------------------------------- ### Create LÖVE Alias on Mac OSX Source: https://love2d.org/wiki/Getting_Started_%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29 Steps to create a bash alias for the LÖVE executable in the ~/.bash_profile file to simplify running LÖVE from the terminal. ```bash open -a TextEdit ~/.bash_profile # alias to love alias love="/Applications/love.app/Contents/MacOS/love" love "~/path/to/mygame" ``` -------------------------------- ### Execute LÖVE Game (Linux) Source: https://love2d.org/wiki/%E5%9F%BA%E7%A4%8E%E5%85%A5%E9%96%80 Commands to run a LÖVE game from the command line on Linux, targeting either a game directory or a packaged .love file. ```bash love /home/path/to/gamedir/ love /home/path/to/packagedgame.love ``` -------------------------------- ### Run Game via Application Package (Mac OS X) Source: https://love2d.org/wiki/No%C5%A3iuni_de_baz%C4%83 Command to execute a LÖVE game using the application package directly from the Terminal on Mac OS X. ```shell /Applications/love.app/Contents/MacOS/love ~/cale/spre/joc ``` -------------------------------- ### Run LÖVE with Real-time Output (macOS) Source: https://love2d.org/wiki/Getting_Started_%28%E6%AD%A3%E9%AB%94%E4%B8%AD%E6%96%87%29 This command uses 'xterm' to run a LÖVE game, displaying any printed output in a separate terminal window. This is useful for debugging and monitoring game output in real-time. ```bash xterm -e /Applications/love.app/Contents/MacOS/love "/home/path/to/game" ``` -------------------------------- ### Lua Code Example Formatting Source: https://love2d.org/wiki/Talk%3AGuidelines Provides guidelines for writing Lua script examples for the wiki. It emphasizes testing examples, using four spaces instead of tabs, and utilizing the wiki's source code formatting with language specification. ```lua shape = love.physics.newCircleShape( radius ) ``` -------------------------------- ### ParticleSystem:start Source: https://love2d.org/wiki/ParticleSystem%3Astart Starts the particle emitter. This function does not take any arguments and does not return any values. ```APIDOC ## ParticleSystem:start ### Description Starts the particle emitter. ### Method None ### Endpoint None ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (None) - The function does not return any values. #### Response Example None ``` -------------------------------- ### Basic LÖVE 'Hello World' Game Source: https://love2d.org/wiki/%E5%9F%BA%E7%A4%8E%E5%85%A5%E9%96%80 A simple Lua script for LÖVE that displays 'Hello World' at specified coordinates on the screen. This is the fundamental drawing function in LÖVE. ```lua function love.draw() love.graphics.print("Hello World", 400, 300) end ``` -------------------------------- ### Add LOVE Graphics SetPoint Example Source: https://love2d.org/wiki/Special%3AContributions/Tentus This edit to 'love.graphics.setPoint' adds an example to the documentation. Providing practical examples is crucial for user understanding and is a recurring theme in wiki contributions. ```lua -- Add an example for love.graphics.setPoint ``` -------------------------------- ### Run LÖVE Game on macOS (Terminal) Source: https://love2d.org/wiki/Getting_Started_%28Slovensk%C3%BD%29 Commands to run a LÖVE game on macOS using the terminal. Demonstrates running the application directly for output and using an alias for convenience. ```bash open -n -a love "~/path/to/mygame" /Applications/love.app/Contents/MacOS/love ~/path/to/mygame # alias to love alias love="/Applications/love.app/Contents/MacOS/love" love ~/path/to/mygame ``` -------------------------------- ### Create LÖVE Alias (Mac OS X) Source: https://love2d.org/wiki/No%C5%A3iuni_de_baz%C4%83 Instructions and code to create a shell alias in ~/.bash_profile on Mac OS X to easily run LÖVE from the command line. ```shell open -a TextEdit ~/.bash_profile touch ~/.bash_profile # alias către love alias love="/Applications/love.app/Contents/MacOS/love" ``` -------------------------------- ### Enable LÖVE Console Output (Windows) Source: https://love2d.org/wiki/%E5%9F%BA%E7%A4%8E%E5%85%A5%E9%96%80 Command to run LÖVE with a console window, which is useful for viewing print statements and debugging output. ```bash love --console ``` -------------------------------- ### RecordingDevice:start Source: https://love2d.org/wiki/RecordingDevice%3Astart Begins recording audio using the specified device with configurable parameters for sample count, sample rate, bit depth, and channels. ```APIDOC ## RecordingDevice:start ### Description Begins recording audio using this device. Available since LÖVE 11.0. ### Method `RecordingDevice:start( samplecount, samplerate, bitdepth, channels )` ### Parameters #### Arguments * **samplecount** (number) - The maximum number of samples to store in an internal ring buffer. * **samplerate** (number, optional) - The number of samples per second to store. Defaults to 8000. * **bitdepth** (number, optional) - The number of bits per sample. Defaults to 16. * **channels** (number, optional) - Whether to record in mono or stereo. Defaults to 1. ### Returns * **success** (boolean) - True if the device successfully began recording, false otherwise. ### Notes A ring buffer is used internally. If the buffer fills up, the oldest data will be lost. ### Related Functions * RecordingDevice:getData * RecordingDevice:stop ``` -------------------------------- ### Execute LÖVE Game (macOS) Source: https://love2d.org/wiki/%E5%9F%BA%E7%A4%8E%E5%85%A5%E9%96%80 Commands to run a LÖVE game from the command line on macOS, using the 'open' command or directly calling the executable. ```bash open -n -a love "/home/path/to/game" /Applications/love.app/Contents/MacOS/love mygame ``` -------------------------------- ### Create LÖVE Alias (macOS) Source: https://love2d.org/wiki/%E5%9F%BA%E7%A4%8E%E5%85%A5%E9%96%80 Instructions to create a shell alias in ~/.bash_profile for macOS to easily execute LÖVE from the command line. ```bash # alias to love alias love="/Applications/love.app/Contents/MacOS/love" ``` -------------------------------- ### Merge Page History (GET Request Example) Source: https://love2d.org/wiki/Special%3AApiHelp/mergehistory Example of a GET request to merge the entire history of one page into another using the MediaWiki API's mergehistory module. Requires a CSRF token and optionally accepts a reason and timestamp. ```api api.php?action=mergehistory&from=Oldpage&to=Newpage&token=123ABC&reason=Reason ``` -------------------------------- ### Merge Page History up to Timestamp (GET Request Example) Source: https://love2d.org/wiki/Special%3AApiHelp/mergehistory Example of a GET request to merge page revisions up to a specific timestamp from one page into another using the MediaWiki API's mergehistory module. Requires a CSRF token and optionally accepts a reason. ```api api.php?action=mergehistory&from=Oldpage&to=Newpage&token=123ABC&reason=Reason×tamp=2015-12-31T04%3A37%3A41Z ``` -------------------------------- ### Profile Lua Code with profile.lua in LOVE2D Source: https://love2d.org/wiki/profile This Lua code demonstrates how to integrate and use the 'profile.lua' module within the LOVE2D framework. It shows how to start, stop, reset, and report profiling data, essential for identifying performance bottlenecks. The example includes setup in love.load, data collection in love.update, and report display in love.draw. ```lua -- setup function love.load() love.profiler = require('profile') love.profiler.start() end -- generates a report every 100 frames love.frame = 0 function love.update(dt) love.frame = love.frame + 1 if love.frame%100 == 0 then love.report = love.profiler.report(20) love.profiler.reset() end end -- prints the report function love.draw() love.graphics.print(love.report or "Please wait...") end ``` -------------------------------- ### Get Parabola Coefficients Source: https://love2d.org/wiki/User%3ADarkfrei/example_functions This Lua function calculates the coefficients (a, b, c) for a parabolic trajectory equation given physical parameters. It takes gravity (g), initial velocity (v0), launch angle in radians (alpha), and starting coordinates (x0, y0). The output coefficients can then be used with the `parabolaGetValue` function to determine the trajectory. ```lua function getParabolaCoefficients (g, v0, alpha, x0, y0) local a = -0.5*g/(v0*cos(alpha))^2 local b = tan(alpha) - 2*a*x0 local c = y0 - b*x0 - a*x0^2 return a, b, c end ``` -------------------------------- ### Send email to a user via MediaWiki API (GET Request) Source: https://love2d.org/wiki/Special%3AApiHelp/emailuser This example demonstrates how to send an email to a specific user using the MediaWiki API. It requires the target username, the email subject, the email body, and a CSRF token. Note that this module typically requires POST requests, but a GET example is provided for illustration. ```plaintext api.php?action=emailuser&target=WikiSysop&text=Content&token=123ABC ``` -------------------------------- ### Run LÖVE with Real-time Output (macOS) Source: https://love2d.org/wiki/%E5%9F%BA%E7%A4%8E%E5%85%A5%E9%96%80 A bash script for OS X Lion and later to run LÖVE and capture print() output in a separate xterm window for real-time debugging. ```bash #!/bin/bash exec /Applications/love.app/Contents/MacOS/love "/home/path/to/game" ``` -------------------------------- ### Get Joystick GUID Source: https://love2d.org/wiki/Special%3ABrowse/%3AJoystick%3AgetGUID Retrieves a stable GUID unique to the type of the physical joystick. This function is available since version 0.9.0. ```lua Joystick:getGUID() ``` -------------------------------- ### Get BezierCurve Segment (Lua) Source: https://love2d.org/wiki/BezierCurve%3AgetSegment Retrieves a segment of a BezierCurve between specified start and end points. The start and end points must be numbers between 0 and 1. It returns a new BezierCurve object. ```lua curve = BezierCurve:getSegment( startpoint, endpoint ) ``` -------------------------------- ### Lua Template:param Example Source: https://love2d.org/wiki/Template%3Aparam Provides a concrete example of using the 'param' template to document a parameter named 'align' for a page named 'AlignMode'. ```Lua {{param|AlignMode|align|Text Alignment}} ``` -------------------------------- ### Install LÖVE Dependencies on Gentoo Source: https://love2d.org/wiki/Building_L%C3%96VE_%28Rom%C3%A2n%C4%83%29 Installs core libraries and build tools for LÖVE on Gentoo using emerge. This command installs packages for Lua, physics, multimedia, and graphics. ```bash emerge -va lua physfs libsdl opengl devil freetype openal libvorbis mpg123 libmodplug ``` -------------------------------- ### Get Texture Width (Lua) Source: https://love2d.org/wiki/Special%3AWhatLinksHere/Texture Provides an example of getting the width of a texture object in LÖVE using the `getWidth` method. This is useful for calculations involving image dimensions. ```lua local texWidth = texture:getWidth() ``` -------------------------------- ### Full Audio Control Example in LÖVE Source: https://love2d.org/wiki/User%3AZorg/Manual%3AAudio/1 Demonstrates a complete audio playback control system within LÖVE's main loop. It uses key presses ('p' for pause, 'r' for resume, 'return' for restart) to interact with an audio source. ```lua local samsMusic function love.load() samsMusic = love.audio.newSource('sound.ogg') end function love.keypressed(key) if key == "p" then samsMusic:pause() end if key == "r" then samsMusic:resume() end -- Replay the sound if key == "return" then samsMusic:stop() samsMusic:play() end end ``` -------------------------------- ### MediaWiki API: Reset Password for Email (GET Request) Source: https://love2d.org/wiki/Special%3AApiHelp/resetpassword Example of sending a password reset email for a specific email address via the MediaWiki API using a GET request. Requires the email address and a token. ```api api.php?action=resetpassword&user=user@example.com&token=123ABC ``` -------------------------------- ### Get Joystick GUID (LÖVE) Source: https://love2d.org/wiki/Joystick%3AgetGUID Retrieves a stable, platform-dependent GUID for a joystick type. This function is available from LÖVE version 0.9.0 onwards and requires no arguments. It returns a string representing the unique identifier. ```lua guid = Joystick:getGUID( ) ``` -------------------------------- ### MediaWiki API: Reset Password (GET Request) Source: https://love2d.org/wiki/Special%3AApiHelp/resetpassword Example of sending a password reset email to a user via the MediaWiki API using a GET request. Requires a user and a token. The token is typically obtained from action=query&meta=tokens. ```api api.php?action=resetpassword&user=Example&token=123ABC ``` -------------------------------- ### LÖVE 'Hello World' Example Source: https://love2d.org/wiki/L%C3%96VE_%28%E6%97%A5%E6%9C%AC%E8%AA%9E%29 A basic 'Hello World' example for LÖVE. This code, when executed, will display 'Hello World!' in white text on a black background within a 600x800 window. ```lua function love.draw() love.graphics.print('Hello World!', 400, 300) end ``` -------------------------------- ### Install LÖVE Dependencies on Gentoo Source: https://love2d.org/wiki/Building_L%C3%96VE_%28T%C3%BCrk%C3%A7e%29 Installs LÖVE dependencies on Gentoo using Emerge. It also includes a separate command to ensure build tools like automake and autoconf are installed. ```bash emerge -va lua physfs libsdl opengl devil freetype openal libvorbis mpg123 libmodplug ``` ```bash emerge -va automake autoconf libtool ``` -------------------------------- ### ParticleSystem:start Source: https://love2d.org/wiki/Special%3AAsk/-5B-5BCategory%3AFunctions-5D-5D-20-5B-5Bparent%3A%3AParticleSystem-7C-7CDrawable-7C-7CObject-5D-5D-20-5B-5BConcept%3ACurrent-5D-5D/-3FDescription/-3FPrettySince/-3FPrettyRemoved/mainlabel%3D/limit%3D50/offset%3D50/format%3Dtemplate/headers%3Dhide/template%3DListingFields/introtemplate%3DListingIntro/outrotemplate%3DListingOutro Starts the particle emitter. This begins the process of emitting particles according to the configured settings. ```APIDOC ## ParticleSystem:start ### Description Starts the particle emitter. ### Method Various (Assumed as an action method based on naming convention) ### Endpoint `/ParticleSystem/start` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```lua -- Example assuming a Lua environment where ParticleSystem is an object particleSystem:start() ``` ### Response #### Success Response (200) None (Action methods typically return void or a status indicator) #### Response Example None ``` -------------------------------- ### Get User Contributions Feed (API Example) Source: https://love2d.org/wiki/Special%3AApiHelp/feedcontributions This example demonstrates how to use the MediaWiki API to retrieve a user's contributions feed. It requires specifying the 'user' parameter. The feed format defaults to RSS. ```api api.php?action=feedcontributions&user=Example ``` -------------------------------- ### MediaWiki API: Link Account Example Source: https://love2d.org/wiki/Special%3AApiHelp/linkaccount This example demonstrates how to initiate the process of linking an account from a third-party provider ('Example') using the MediaWiki API. It requires a valid 'linktoken' and an absolute 'linkreturnurl'. ```api api.php?action=linkaccount&provider=Example&linkreturnurl=http://example.org/&linktoken=123ABC ``` -------------------------------- ### Upload File from URL (API Example) Source: https://love2d.org/wiki/Special%3AApiHelp/upload This example demonstrates how to upload a file to MediaWiki by providing a URL. It requires the filename, the URL of the file, and a CSRF token for authentication. The request is made via GET to the api.php script. ```api api.php?action=upload&filename=Wiki.png&url=http%3A//upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png&token=123ABC ``` -------------------------------- ### Get Joystick GUID - Lua Source: https://love2d.org/wiki/Special%3ABrowse/%3AJoystick-5F%28%E6%97%A5%E6%9C%AC%E8%AA%9E%29 Retrieves the globally unique identifier (GUID) for a joystick. This can be used to persistently identify and configure specific devices. ```lua local guid = joystick:getGUID() ``` -------------------------------- ### Create LOVE Game Batch File (Windows Batch) Source: https://love2d.org/wiki/Batch_Start This batch script allows you to launch a LOVE game by simply double-clicking the .bat file. It starts the LOVE executable, assuming it's installed in the default program files location or a specified path. This is a Windows-specific method. ```batch @ECHO OFF start " " "%PROGRAMFILES(x86)%\LOVE\love.exe" ``` ```batch @ECHO OFF start " " "Path\To\love.exe" ``` -------------------------------- ### Configure LÖVE Window Settings Source: https://love2d.org/wiki/Config_Files_%28%D0%A3%D0%BA%D1%80%D0%B0%D1%97%D0%BD%D1%81%D1%8C%D0%BA%D0%B0%29 Sets minimum window dimensions, fullscreen behavior, vsync, and multisample anti-aliasing. ```lua t.window.minwidth = 1 -- Мінімальна ширина вікна, якщо її можна міняти (number / число) t.window.minheight = 1 -- Мінімальна висота вікна, якщо її можна міняти (number / число) t.window.fullscreen = false -- Включити повноекранний режим (boolean / логічна) t.window.fullscreentype = "normal" -- Стандартний повноекранний режим чи режим з доступом до робочого стола (string / рядок) t.window.vsync = true -- Чи включити вертикальну синхронізацію (boolean / логічна) t.window.fsaa = 0 -- Кількість вибірок для згладжування з множинною вибіркою (number / число) t.window.display = 1 -- Індекс монітора, на якому буде показано вікно (number / число) ``` -------------------------------- ### Love2D Lua Tests - Code Examples Source: https://love2d.org/wiki/Tutorial Provides numerous code examples for various game development issues in LÖVE. These examples serve as quick tutorials for graphics, vectors, polygons, interaction, collisions, raycasting, tiles, Voronoi graphs, meshes, menus, and Android development. ```lua --- Code examples that work as quick tutorials for various game-related issues and development: graphics, vectors, polygons, interaction, collisions, raycasting, tiles, Voronoi graphs, meshes, menus, Android development and much more... -- Example for graphics: love.graphics.print('Hello, LÖVE!', 400, 300) -- Example for vectors: local vec1 = {x=10, y=20} local vec2 = {x=5, y=15} local sumVec = {x=vec1.x + vec2.x, y=vec1.y + vec2.y} print('Sum of vectors: ' .. sumVec.x .. ', ' .. sumVec.y) ``` -------------------------------- ### Get VideoStream Information (Lua) Source: https://love2d.org/wiki/VideoStream Retrieves information about the VideoStream, such as its filename and current playback status. These functions are available starting from LÖVE version 0.10.0. ```lua local filename = videoStream:getFilename() local isPlaying = videoStream:isPlaying() local currentTime = videoStream:tell() ``` -------------------------------- ### ParticleSystem:start Source: https://love2d.org/wiki/Special%3AAsk/-5B-5BCategory%3AFunctions-5D-5D-20-5B-5Bparent%3A%3AParticleSystem-7C-7CDrawable-7C-7CObject-5D-5D-20-5B-5BConcept%3ACurrent-5D-5D/-3FDescription/-3FPrettySince/-3FPrettyRemoved/mainlabel%3D/limit%3D50/offset%3D50/format%3Dtemplate/headers%3Dhide/template%3DListingFields/introtemplate%3DListingIntro/outrotemplate%3DListingOutro Starts the particle emitter, initiating the particle generation process. ```lua ParticleSystem:start ``` -------------------------------- ### RecordingDevice:getChannelCount Source: https://love2d.org/wiki/RecordingDevice%3AgetChannelCount Gets the number of channels currently being recorded (mono or stereo). This function is available starting from LÖVE version 11.0. ```APIDOC ## GET RecordingDevice:getChannelCount ### Description Retrieves the number of audio channels currently being recorded by the RecordingDevice. Returns 1 for mono and 2 for stereo. ### Method GET ### Endpoint /RecordingDevice/getChannelCount ### Parameters None. ### Request Example ```json { "message": "No request body needed for this operation." } ``` ### Response #### Success Response (200) - **channels** (number) - The number of channels being recorded (1 for mono, 2 for stereo). #### Response Example ```json { "channels": 2 } ``` ``` -------------------------------- ### SECL Basic Class Example Source: https://love2d.org/wiki/SECL Demonstrates the basic usage of SECL for creating and using classes. It shows how to instantiate a class, set properties, and define methods. This requires 'class.lua' to be in the same directory. ```lua require "class" --this assumes you've saved the code above in class.lua myclass = class:new() myclass.value = 13 function myclass:setvalue(v) self.value = v end object = myclass:new() object:setvalue(128) --myclass.value is still 13 and object.value is now 128 anotherObject = object:new() --anotherObject.value is 128 ``` -------------------------------- ### Complete Upload with Warnings Ignored (API Example) Source: https://love2d.org/wiki/Special%3AApiHelp/upload This example shows how to complete a file upload that may have encountered warnings. It uses the filename, a filekey obtained from a previous partial upload, an option to ignore warnings, and a CSRF token. The request is made via GET to the api.php script. ```api api.php?action=upload&filename=Wiki.png&filekey=filekey&ignorewarnings=1&token=123ABC ``` -------------------------------- ### LÖVE 0.8.0 Configuration Example Source: https://love2d.org/wiki/Config_Files_%28%D0%A3%D0%BA%D1%80%D0%B0%D1%97%D0%BD%D1%81%D1%8C%D0%BA%D0%B0%29 Defines game title, author, version, and screen settings for LÖVE 0.8.0. ```lua function love.conf(t) t.title = "Untitled" -- Заголовок вікна гри (string / рядок) t.author = "Unnamed" -- Автор гри (string / рядок) t.url = nil -- Веб-сайт гри (string / рядок) t.identity = nil -- Назва директорії для збережених ігор (string / рядок) t.version = "0.8.0" -- Версія LÖVE, для якої була зроблена гра (string / рядок) t.console = false -- Чи додати консоль (boolean / логічна, тільки для Windows) t.release = false -- Включити режим стабільної версії (boolean / логічна) t.screen.width = 800 -- Ширина вікна (number / число) t.screen.height = 600 -- Висота вікна (number / число) t.screen.fullscreen = false -- Включити повноекранний режим (boolean / логічна) t.screen.vsync = true -- Чи включити вертикальну синхронізацію (boolean / логічна) t.screen.fsaa = 0 -- Кількість вибірок для згладжування з множинною вибіркою (number / число) t.modules.joystick = true -- Включити модуль joystick (boolean / логічна) t.modules.audio = true -- Включити модуль audio (boolean / логічна) t.modules.keyboard = true -- Включити модуль keyboard (boolean / логічна) t.modules.event = true -- Включити модуль event (boolean / логічна) t.modules.image = true -- Включити модуль image (boolean / логічна) t.modules.graphics = true -- Включити модуль graphics (boolean / логічна) t.modules.timer = true -- Включити модуль timer (boolean / логічна) t.modules.mouse = true -- Включити модуль mouse (boolean / логічна) t.modules.sound = true -- Включити модуль sound (boolean / логічна) t.modules.physics = true -- Включити модуль physics (boolean / логічна) t.modules.thread = true -- Включити модуль thread (boolean / логічна) end ``` -------------------------------- ### ParticleSystem:getSizeVariation Source: https://love2d.org/wiki/ParticleSystem%3AgetSizeVariation Gets the amount of size variation for a ParticleSystem. This value ranges from 0 (no variation) to 1 (full variation between start and end size). ```APIDOC ## GET ParticleSystem:getSizeVariation ### Description Retrieves the size variation setting of a particle system. This determines how much the size of individual particles can deviate from the specified start and end sizes. ### Method GET ### Endpoint /ParticleSystem/getSizeVariation ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **variation** (number) - The amount of size variation, ranging from 0 (no variation) to 1 (full variation). #### Response Example ```json { "variation": 0.5 } ``` ``` -------------------------------- ### Full conf.lua Example with LÖVE 0.9.0 Options Source: https://love2d.org/wiki/Config_Files_%28Polski%29 Provides a comprehensive example of the `love.conf` function, demonstrating various configuration options available in LÖVE 0.9.0. This includes settings for game identity, version, console, window properties (title, icon, size, fullscreen, vsync, etc.), and module activation. ```lua function love.conf(t) t.identity = nil -- Nazwa folderu ze stanami gry (string) t.version = "0.9.0" -- Wersja LÖVE, dla której gra została wykonana (string) t.console = false -- Czy dodać terminal (boolean, tylko w systemie Windows) t.window.title = "Untitled" -- Tytuł okienka z grą (string) t.window.icon = nil -- Ścieżka do obrazka, który posłuży za ikonę okna (string) t.window.width = 800 -- Szerokość okienka (number) t.window.height = 600 -- Wysokość okienka (number) t.window.borderless = false -- Czy usunąć wszelkie obramowanie okna (boolean) t.window.resizable = false -- Czy pozwalać użytkownikowi na zmianę rozmiaru okna (boolean) t.window.minwidth = 1 -- Najmniejsza dopuszczalna szerokość okna (jeśli można zmieniać rozmiar) (number) t.window.minheight = 1 -- Najmniejsza dopuszczalna wysokość okna (jeśli można zmieniać rozmiar) (number) t.window.fullscreen = false -- Tryb pełnoekranowy (boolean) t.window.fullscreentype = "normal" -- Standardowy tryb pełnoekranowy lub tryb 'desktop' (string) t.window.vsync = true -- Synchronizacja pionowa (boolean) t.window.fsaa = 0 -- Ilość buforów FSAA (number) t.window.display = 1 -- Numer monitora na którym ma być wyświetlane okno (number) t.modules.audio = true -- Aktywacja modułu obsługi audio (boolean) t.modules.event = true -- Aktywacja modułu obsługi eventów (boolean) t.modules.graphics = true -- Aktywacja modułu wyświetlania grafiki (boolean) t.modules.image = true -- Aktywacja modułu image (boolean) t.modules.joystick = true -- Aktywacja modułu obsługi dżojstika (boolean) t.modules.keyboard = true -- Aktywacja modułu obsługi klawiatury (boolean) t.modules.math = true -- Aktywacja modułu math (boolean) t.modules.mouse = true -- Aktywacja modułu obsługi myszy (boolean) t.modules.physics = true -- Aktywacja modułu obsługi fizyki (boolean) t.modules.sound = true -- Aktywacja modułu sound (boolean) t.modules.system = true -- Aktywacja modułu system (boolean) t.modules.timer = true -- Aktywacja modułu timer (boolean) t.modules.window = true -- Aktywacja modułu obsługi window (boolean) end ``` -------------------------------- ### Complete Input Handling Example (LÖVE) Source: https://love2d.org/wiki/Tutorial%3AUsing_Input Combines `love.load`, `love.update`, `love.draw`, `love.keypressed`, and `love.keyreleased` to demonstrate comprehensive keyboard input handling. ```lua function love.load() love.graphics.setFont(12) text = "Nothing yet" end function love.update(dt) if love.keyboard.isDown( " " ) then text = "The SPACE key is held down!" end end function love.draw() love.graphics.print( text, 330, 300 ) end function love.keypressed( key ) if key == "return" then text = "RETURN is being pressed!" end end function love.keyreleased( key ) if key == "return" then text = "RETURN has been released!" end end ``` -------------------------------- ### Get Reaction Torque (Removed in LOVE 0.8.0) Source: https://love2d.org/wiki/Joint%3AgetReactionTorque This is a version of the Joint:getReactionTorque function that was removed starting from LOVE version 0.8.0. It did not require any arguments. ```lua torque = Joint:getReactionTorque( ) ``` -------------------------------- ### LÖVE 'Hello, World!' Example Source: https://love2d.org/wiki/Main_Page_%28Polski%29 This is a basic 'Hello, World!' program written in LÖVE. When executed, it displays white text on a black background within an 800x600 window. It demonstrates the fundamental `love.draw()` function for rendering graphics. ```lua function love.draw() love.graphics.print('Witaj, świecie!', 400, 300) end ``` -------------------------------- ### MediaWiki API: Reset all preferences Source: https://love2d.org/wiki/Special%3AApiHelp/options Resets all user preferences to their default values using the MediaWiki API. Requires a CSRF token for authentication. This is a simple GET request example. ```api api.php?action=options&reset=&token=123ABC ``` -------------------------------- ### Get Mesh Draw Range (Lua) Source: https://love2d.org/wiki/Mesh%3AgetDrawRange Retrieves the start and end indices of vertices used when drawing a Mesh. Returns nil if the draw range has not been set previously. ```lua min, max = Mesh:getDrawRange( ) ``` -------------------------------- ### Get CompressedImageData Width (LÖVE 0.9.0+) Source: https://love2d.org/wiki/CompressedImageData%3AgetWidth Retrieves the width of the CompressedImageData. This function is available starting from LÖVE version 0.9.0. It does not take any arguments and returns a number representing the width. ```lua width = CompressedImageData:getWidth( ) ``` -------------------------------- ### LOVE.js Shader Setup and Usage Source: https://love2d.org/wiki/Tutorial%3AIntroduction_to_Shaders Demonstrates how to create a new shader object using a GLSL file and how to set and unset the shader for drawing operations within the LOVE.js framework. It handles the initialization of the shader and its application to a graphical element. ```lua function love.load() shader = love.graphics.newShader("shader.fs") end function love.draw() love.graphics.setShader(shader) love.graphics.rectangle("fill", 0, 0, 100, 100) love.graphics.setShader() end ``` -------------------------------- ### Load an Audio Source in LÖVE Source: https://love2d.org/wiki/User%3AZorg/Manual%3AAudio/1 Creates a new audio source object from a given file. This is the first step to playing any sound in LÖVE. It requires a file path as input. ```lua local source = love.audio.newSource('sound.ogg') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.