LuaLibraries.wiki
author Wuzzy
Wed, 30 Oct 2019 11:16:13 +0000
changeset 2083 1a16f75c6b5c
parent 1808 dc1bfd3a62ac
permissions -rw-r--r--
Themes: add newline

#summary Overview of libraries for writing Lua scripts in Hedgewars

= Lua libraries =

== Introduction ==
Libraries in scripts in Hedgewars are Lua files that are used by many scripts to add a common function, as an example the `Locale` library that allows scripts to translate text. The variables in these files are not exposed to the script using it but all the functions can be called.

== Usage ==
To use a library you only need to add this function call at the top of the script:
<code language="lua">HedgewarsScriptLoad("Scripts/<Library Name>.lua")</code>
Where `<Library Name>` is replaced by the name.

== List of Lua libraries ==

 * [LuaLibraryLocale Locale]
 * [LuaLibraryParams Params]
 * [LuaLibraryTracker Tracker]
 * [LuaLibraryAnimate Animate]
 * [LuaLibraryUtils Utils]
 * [LuaLibraryTargetPractice TargetPractice]
 * [LuaLibrarySpeedShoppa SpeedShoppa]
 * [LuaLibrarySimpleMission SimpleMission]
 * [LuaLibraryAchievements Achievements]