Welcome to EasyButton, the simplest way to add buttons to your LÖVE2D projects! EasyButton is designed for beginners and experts alike, making it super easy to create interactive buttons in your games or applications.
To use EasyButton, follow these steps:
Download the EasyButton library from the following link:
Download EasyButtonExtract the downloaded EasyButton folder and add the button.lua
file into your LÖVE2D project directory.
main.lua
Include EasyButton in your main.lua
file to start using it:
-- main.lua
local Button = require "button"
Now, create a simple button in your main.lua
file:
-- main.lua
local myButton
function love.load()
myButton = Button:new(100, 100, 200, 50, "Click Me!")
end
function love.update(dt)
myButton:update()
if myButton.pressed then
print("Button was clicked!")
myButton.pressed = false -- Reset the pressed state
end
end
function love.draw()
myButton:draw()
end
EasyButton provides several features to enhance button functionality in your LÖVE2D projects:
With these features, EasyButton simplifies the process of adding interactive buttons, making it ideal for both beginners and experienced developers.
You can download the EasyButton library from the following link:
Download EasyButton