fix tests
This commit is contained in:
parent
683dfb96de
commit
634b395a20
|
@ -9,6 +9,9 @@
|
||||||
|
|
||||||
-- draw button and queue up event handlers
|
-- draw button and queue up event handlers
|
||||||
function button(State, name, params)
|
function button(State, name, params)
|
||||||
|
if State.button_handlers == nil then
|
||||||
|
State.button_handlers = {}
|
||||||
|
end
|
||||||
if params.bg then
|
if params.bg then
|
||||||
love.graphics.setColor(params.bg.r, params.bg.g, params.bg.b, params.bg.a)
|
love.graphics.setColor(params.bg.r, params.bg.g, params.bg.b, params.bg.a)
|
||||||
love.graphics.rectangle('fill', params.x,params.y, params.w,params.h, 5,5)
|
love.graphics.rectangle('fill', params.x,params.y, params.w,params.h, 5,5)
|
||||||
|
@ -19,6 +22,9 @@ end
|
||||||
|
|
||||||
-- process button event handlers
|
-- process button event handlers
|
||||||
function mouse_press_consumed_by_any_button(State, x, y, mouse_button)
|
function mouse_press_consumed_by_any_button(State, x, y, mouse_button)
|
||||||
|
if State.button_handlers == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
local button_pressed = false
|
local button_pressed = false
|
||||||
local consume_press = true
|
local consume_press = true
|
||||||
for _,ev in ipairs(State.button_handlers) do
|
for _,ev in ipairs(State.button_handlers) do
|
||||||
|
|
Loading…
Reference in New Issue