Simple Button Library

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Baggef
Prole
Posts: 20
Joined: Fri Aug 23, 2019 7:30 pm
Location: USA
Contact:

Simple Button Library

Post 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
Last edited by Baggef on Sun Aug 25, 2019 12:50 am, edited 6 times in total.
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Simple Button Library

Post 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.
User avatar
Baggef
Prole
Posts: 20
Joined: Fri Aug 23, 2019 7:30 pm
Location: USA
Contact:

Re: Simple Button Library

Post 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.
gaeem defelpmint is maiy pashin
Itch: Freakman
Post Reply

Who is online

Users browsing this forum: No registered users and 43 guests