|
|
Line 1: |
Line 1: |
− | {{Languages|Powder Toy Lua API}}
| |
| | | |
− | The Powder Toy Lua API is a set of objects and functions that allow control over most aspects of the game, including graphics, element interactions, and interfaces.
| |
− |
| |
− | If you are new to the Lua programming language, you should familiarize yourself with how to code in Lua. A great beginner's tutorial is available [https://www.lua.org/pil/contents.html here]
| |
− |
| |
− | boxmein made a massive reference to most parts of the API, including some that are not added to this wiki yet. Regardless, this reference is extremely outdated and hasn't been updated in years.
| |
− | You can find it [https://web.archive.org/web/20201023090302/https://www.boxmein.net/tpt/tptelements/reference/lua-reference.html here].
| |
− |
| |
− | The API is split into several categories
| |
− | ; [[Lua_API:Interface|Interface]]
| |
− | : Includes UI components such as buttons, labels and checkboxes, access to the very primitive window manager and input events
| |
− | ; [[Lua_API:Renderer|Renderer]]
| |
− | : Methods and constants for interacting with the display mode
| |
− | ; [[Lua_API:Elements|Elements]]
| |
− | : Methods and constants for modifying and creating elements
| |
− | ; [[Lua_API:Simulation|Simulation]]
| |
− | : Methods for modifying the state of the simulation
| |
− | ; [[Lua_API:Graphics|Graphics]]
| |
− | : Methods for drawing simple shapes and text on screen.
| |
− | ; [[Lua_API:File_System|File System]]
| |
− | : Functions for creating, deleting, modifying and enumerating files and folders.
| |
− | ; [[Lua_API:Platform|Platform]]
| |
− | : Functions for doing OS-level things like opening URLs or interacting with the clipboard.
| |
− | ; [[Lua_API:Event|Event]]
| |
− | : Listen for events, such as mouseclicks or key presses.
| |
− | ; [http://w3.impa.br/~diego/software/luasocket/ Socket]
| |
− | : Built-in LuaSocket library available as the <code>socket</code> global.
| |
− | ; [[Lua_API:HTTP|HTTP]]
| |
− | : Provides access to basic HTTP functionality in the form of request objects.
| |
− | ; [[Lua_API:Bit|Bit]]
| |
− | : Doesn't actually provide any interaction with the game, but provides some functions for performing bitwise operations on integer numbers.
| |
− | ; [[Lua|Legacy]]
| |
− | : Old Lua API with the tpt.* prefix
| |
− |
| |
− | [[Category:Lua]]
| |