Merge carousel.love
This commit is contained in:
commit
ef71fef7b9
|
@ -26,6 +26,8 @@ on.draw = function()
|
||||||
--
|
--
|
||||||
draw_menu()
|
draw_menu()
|
||||||
draw_next_frames_of_animations()
|
draw_next_frames_of_animations()
|
||||||
|
if Window_in_focus then
|
||||||
draw_button_tooltips(Global_state)
|
draw_button_tooltips(Global_state)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
|
@ -0,0 +1 @@
|
||||||
|
Window_focus = true
|
|
@ -0,0 +1,3 @@
|
||||||
|
on.focus = function(in_focus)
|
||||||
|
Window_in_focus = in_focus
|
||||||
|
end
|
6
main.lua
6
main.lua
|
@ -203,6 +203,12 @@ function App.wheelmoved(dx,dy)
|
||||||
if on.mouse_wheel_move then on.mouse_wheel_move(dx,dy) end
|
if on.mouse_wheel_move then on.mouse_wheel_move(dx,dy) end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function App.mousefocus(in_focus)
|
||||||
|
if Mode == 'error' then return end
|
||||||
|
Cursor_time = 0 -- ensure cursor is visible immediately after it moves
|
||||||
|
if on.mouse_focus then on.mouse_focus(in_focus) end
|
||||||
|
end
|
||||||
|
|
||||||
function App.touchpressed(x,y, dx,dy, pressure)
|
function App.touchpressed(x,y, dx,dy, pressure)
|
||||||
if Mode == 'error' then return end
|
if Mode == 'error' then return end
|
||||||
Cursor_time = 0 -- ensure cursor is visible immediately after it moves
|
Cursor_time = 0 -- ensure cursor is visible immediately after it moves
|
||||||
|
|
|
@ -88,6 +88,11 @@ two categories.
|
||||||
right. Positive values for `dy` indicate upward movement.
|
right. Positive values for `dy` indicate upward movement.
|
||||||
(Based on [LÖVE](https://love2d.org/wiki/love.wheelmoved).)
|
(Based on [LÖVE](https://love2d.org/wiki/love.wheelmoved).)
|
||||||
|
|
||||||
|
* `on.mouse_focus(in_focus)` -- called when the mouse pointer moves on or off
|
||||||
|
the app window. `in_focus` will be `true` when mouse comes within the window
|
||||||
|
area, and `false` when it goes off.
|
||||||
|
(Based on [LÖVE](https://love2d.org/wiki/love.mousefocus).)
|
||||||
|
|
||||||
* `on.touch_press(x,y, dx,dy, pressure)` -- called when you touch a
|
* `on.touch_press(x,y, dx,dy, pressure)` -- called when you touch a
|
||||||
multi-touch screen. Provides in `x` and `y` the point on the screen at which
|
multi-touch screen. Provides in `x` and `y` the point on the screen at which
|
||||||
the touch occurred.
|
the touch occurred.
|
||||||
|
|
Loading…
Reference in New Issue