Here is my code
_G.love = require("love")
local ButtonManager = require("button")
ButtonManager.default.width = 100
ButtonManager.default.height = 40
ButtonManager.default.alignment = "center"
local startButton = ButtonManager.new("Start Game", 100, 100, 200, 80)
startButton.onClick = function()
print("Start the game!")
end
local quitButton = ButtonManager.new("Quit", 100, 300, 200, 90)
quitButton.onClick = function()
love.event.quit()
end
function love.load()
-- code
end
function love.draw()
ButtonManager.draw()
end
OnClick doesn't work for me.I am newbie kindly help
Simple button library help
Re: Simple button library help
I bet it doesn't, this is not Javascript. Please refer to the wiki and mousepressed events.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
-
- Prole
- Posts: 12
- Joined: Sat Oct 21, 2023 1:33 pm
Re: Simple button library help
Thank you it woked for .I missed love.mousepressed functions
Re: Simple button library help
Good to hear that.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Who is online
Users browsing this forum: Google [Bot] and 1 guest