This API provides easy access to a term, whether it is an advanced computers screen or an advanced monitor or 5 advanced monitors attached to just one computer.
This package provides …
- … a button creation function, where a button is basically a rectangle with some text in it. A Button can be parameterized: size, position, horizontal/vertical or no text at all, callback function if it gets clicked.
- … a text and label creation function. Clicking a label will run the callback of an associated button.
- … a wrapper for a term with a built in coordinate to element mapping, which can be used to map mouse_click or monitor_touch events to elements (e.g. buttons, created by the buttonAPI). The cool thing about this is, it can even handle elements which are outside of the term, by introducing a "backpanel" with infinite size. This elements can be drawn on the term (= are sticky) or on the backpanel (= none sticky). The backpanel can then be moved around and used to have e.g. multiple pages of buttons, while it's possible at the same time to have some buttons not moving, ever present (e.g. a "next page" - button).
- … a really basic event dispatcher which replaces the ever-present "while true do os.pullEvent …" - loop
- … a ever growing bunch of demos :)/>
The code and additional documentations are available on GitHub. - I appreciate fork/open issues/open pull requests!
Examples
Examples are available on GitHub - demos too.
Of course there are docs available for each demo: GitHub - docs
If you are interessted in using it, have a look at the docs/GetStarted.md
Screenshots
The idea of this API is to provide easer access to common problems according touch and click events in ComputerCraft. It doesn't have any kind of gui or look&feel on it's own, so it's hard to provide amazing screenshots. Nevertheless I captured the screens of the demo programs: imgur.com/a/Ucv8Y
Installer
The installer can be downloaded from pastebin
pastebin get cXYAjesQ installer
pastebin.com/cXYAjesQIt will ask you what packages you want to download (currently api and demos) and it will not override any files unless you run "installer update".