Jump to content




YABA (Yet another button api)

api utility computer

2 replies to this topic

#1 sploders101

  • Members
  • 52 posts

Posted 30 June 2017 - 05:44 AM

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
Why YABA?
  • 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
Enough talking! Where do I get it?!
YABA is available through pastebin at https://pastebin.com/Usr8bRML
pastebin get Usr8bRML button

Documentation:
Spoiler


#2 dodecaflexagon

  • Members
  • 5 posts

Posted 30 June 2017 - 11:13 AM

Nice, does one thing and does it well.

#3 ToxicC00kie1001

  • Members
  • 9 posts

Posted 22 June 2018 - 07:18 AM

An example program would better my understanding of this.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users