Difference between revisions of "Powder Toy Lua API"

From The Powder Toy
Jump to: navigation, search
(Undo revision 4105 by the_new_antoine (talk); wat is this I don't even)
Line 2: Line 2:
  
 
boxmein made an massive reference of the most parts of the API, including these not added to this wiki yet.
 
boxmein made an massive reference of the most parts of the API, including these not added to this wiki yet.
You can find it [http://boxmein.x10.mx/tptelements/lua-reference.html here].
+
You can find it [http://boxmein.net/tptelements/lua-reference.html here].
  
 
The API is split into several categories
 
The API is split into several categories

Revision as of 18:05, 13 December 2014

The Powder Toy Lua API is a set of objects and functions that was introduced in version 83 (The TPT++ Release). They allow control over some aspects of the game, including graphics, element interactions and interfaces.

boxmein made an massive reference of the most parts of the API, including these not added to this wiki yet. You can find it here.

The API is split into several categories

Interface
Includes UI components such as buttons, labels and checkboxes, access to the very primitive window manager and input events
Renderer
Methods and constants for interacting with the display mode
Elements
Methods and constants for modifying and creating elements
Simulation
Methods for modifying the state of the simulation
Graphics
Methods for drawing simple shapes and text on screen.
File System
Functions for creating, deleting, modifying and enumerating files and folders.
Bit
Doesn't actually provide any interaction with the game, but provides some functions for performing bitwise operations on integer numbers.
Legacy
Old Lua API with the tpt.* prefix