'next' button for mobile devices
This commit is contained in:
parent
79ad833d63
commit
3345d055c9
13
0010-on.draw
13
0010-on.draw
|
@ -1,8 +1,17 @@
|
|||
on.draw = function()
|
||||
Buttons.button_handlers = {}
|
||||
local w = App.width('next')
|
||||
button(Buttons, 'next', {x=Safe_width-w-20, y=50, w=w+10, h=love.graphics.getFont():getHeight()+10, bg={r=0.6, g=0.8, b=0.6},
|
||||
icon = function(p)
|
||||
App.color{r=0, g=0, b=0}
|
||||
love.graphics.print('next', p.x+5, p.y+5)
|
||||
end,
|
||||
onpress1 = function()
|
||||
animate(new)
|
||||
end,
|
||||
})
|
||||
if Draw == 'problem' then
|
||||
draw_sum_grid(Problem)
|
||||
elseif Draw == 'char' then
|
||||
draw_sum_grid(Char)
|
||||
else
|
||||
draw_sum_grid(Solution)
|
||||
end
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
on.initialize = function()
|
||||
math.randomseed(os.time())
|
||||
_, _, Safe_width, Safe_height = love.window.getSafeArea()
|
||||
initialize_layout()
|
||||
new()
|
||||
end
|
|
@ -1,4 +1,7 @@
|
|||
on.mouse_press = function(x,y, mouse_button)
|
||||
if mouse_press_consumed_by_any_button_handler(Buttons, x,y, mouse_button) then
|
||||
return
|
||||
end
|
||||
if x >= X and x < X+Square_side and y >= Y and y < Y+Square_side then
|
||||
Cursor = {1, 1}
|
||||
elseif x >= X+Square_side and x < X+Square_side*2 and y >= Y and y < Y+Square_side then
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Buttons = {}
|
|
@ -0,0 +1,2 @@
|
|||
Safe_width = 0
|
||||
Safe_height = 0
|
Loading…
Reference in New Issue