highlight another global

This commit is contained in:
Kartik K. Agaram 2022-05-17 23:24:46 -07:00
parent b544e8c357
commit dc618a419c
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -95,7 +95,7 @@ function love.filedropped(file)
end
function love.draw()
button_handlers = {}
Button_handlers = {}
love.graphics.setColor(1, 1, 1)
love.graphics.rectangle('fill', 0, 0, Screen_width-1, Screen_height-1)
love.graphics.setColor(0, 0, 0)