actually implement buttons
This commit is contained in:
parent
7aeb9afb89
commit
0266e2c2e9
4 changed files with 14 additions and 2 deletions
13
button.lua
13
button.lua
|
@ -30,7 +30,10 @@ function self.createButtons()
|
|||
size = 32,
|
||||
name = 'clipboard',
|
||||
displayname = 'Copy to Clipboard',
|
||||
tooltip = 'Copy to Clipboard'
|
||||
tooltip = 'Copy to Clipboard',
|
||||
func = function()
|
||||
love.system.setClipboardText('ease function goes here')
|
||||
end
|
||||
})
|
||||
|
||||
buttons = s
|
||||
|
@ -78,4 +81,12 @@ function self.render()
|
|||
end
|
||||
end
|
||||
|
||||
function self.mousepressed(x, y, m)
|
||||
for i, v in ipairs(buttons) do
|
||||
if x > v.x and x < v.x + v.size and y > v.y and y < v.y + v.size and m == 1 then
|
||||
if v.func then v.func() end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return self
|
|
@ -327,7 +327,6 @@ function self.mousepressed(x, y, m)
|
|||
if not clickedDropdown and m == 1 then
|
||||
dropdownScrollCache[self.openDropdown] = dropdownScroll
|
||||
self.openDropdown = 0
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
1
main.lua
1
main.lua
|
@ -88,6 +88,7 @@ end
|
|||
|
||||
function love.mousepressed(x, y, m)
|
||||
if dropdown.mousepressed(x, y, m) then return end
|
||||
button.mousepressed(x, y, m)
|
||||
end
|
||||
|
||||
function love.mousereleased(x, y, m)
|
||||
|
|
|
@ -62,6 +62,7 @@ function self.createSliders()
|
|||
name = 'bpm',
|
||||
displayname = 'BPM',
|
||||
snap = 1,
|
||||
tooltip = 'The speed of the preview dot in Beats Per Minute'
|
||||
})
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue