about summary refs log tree commit diff stats
path: root/button.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-17 23:24:46 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-17 23:24:46 -0700
commitdc618a419c3e4c0fb3519b294dc741ad0b2221be (patch)
tree798745331a4550fd093551df99304ccac250e184 /button.lua
parentb544e8c3576aec557f384c5d31224c6cfe625de7 (diff)
downloadlines.love-dc618a419c3e4c0fb3519b294dc741ad0b2221be.tar.gz
highlight another global
Diffstat (limited to 'button.lua')
-rw-r--r--button.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/button.lua b/button.lua
index cc48b26..42c44e3 100644
--- a/button.lua
+++ b/button.lua
@@ -1,18 +1,18 @@
 -- simple immediate-mode buttons
 
-button_handlers = {}
+Button_handlers = {}
 
 -- draw button and queue up event handlers
 function button(name, params)
   love.graphics.setColor(params.color[1], params.color[2], params.color[3])
   love.graphics.rectangle('fill', params.x,params.y, params.w,params.h, 5,5)
   if params.icon then params.icon(params.x, params.y) end
-  table.insert(button_handlers, params)
+  table.insert(Button_handlers, params)
 end
 
 -- process button event handlers
 function propagate_to_button_handlers(x, y, mouse_button)
-  for _,ev in ipairs(button_handlers) do
+  for _,ev in ipairs(Button_handlers) do
     if x>ev.x and x<ev.x+ev.w and y>ev.y and y<ev.y+ev.h then
       if ev.onpress1 and mouse_button == 1 then ev.onpress1() end
     end