Page 1 of 1

Simple Button Library

Posted: Sat Aug 24, 2019 6:36 am
by Baggef
I have created a button library for those who want a quick solution to a button and not an entire GUI overhaul. A typical button can be created like so:

Code: Select all

function love.load()
   --                         Label, x, y, width, height
   button = ButtonManager.new("Hello World!", 100, 100, 100,50)
end
You can read more and download the files on my github:
https://github.com/Baggef/Simple-Button

Re: Simple Button Library

Posted: Sat Aug 24, 2019 1:29 pm
by bobbyjones
It seems like a nice simple library. The only critique I have is that your library loads itself into the global scope. I am pretty certain that the standard in the Lua community is to have it use a local and return that local variable.

Re: Simple Button Library

Posted: Sun Aug 25, 2019 12:49 am
by Baggef
bobbyjones wrote: Sat Aug 24, 2019 1:29 pm The only critique I have is that your library loads itself into the global scope.
Hey! Thanks for the feedback, its my first time posting something I've made using love and i really appreciate it.

I have made the library load into the local scope. Although i have had some trouble updating the files on love2d's forums, as you can see by the 50 edits I made in the span of 10 minutes. :? So it's only on github now.