YABA
Yet another button API
I didn't personally like any of the currently-implemented button apis out there because they were either way too complicated when all I wanted were simple clickable buttons, or they were too difficult to use. And so, I have created a button api that aims to be as simple and easy to use as possible, without loosing too much functionality.
What can it do?
- Create buttons (duh!)
- Dynamically change existing buttons (including color, text, size, and position)
- If using the window api to house all non-button objects, it can clean itself up when buttons are moved or resized
- Multiple functions can be called from the same button
- Buttons identify themselves to functions they call, allowing hidden information to be stored inside each button
- Yaba provides an object-oriented style to lua, allowing the creation and duplication of a button style using inheritence
- YABA automatically draws buttons for you as their attributes are changed
- Multiple displays are supported through the button.setDisplay(str side) or buttonObj:setDisplay(str side)
- Buttons can be set at active or inactive to allow for multiple pages, etc.
- Buttons support listeners, or the registration and de-registration (using names) of a function subsequently
- Because of the OOP style of this api, inheritance is an option, allowing button styles to be created and then duplicated, reducing the amount of code needed in a program
YABA is available through pastebin at https://pastebin.com/Usr8bRML
pastebin get Usr8bRML button
Documentation:
Spoiler