#49 add on_mouse_hover to hover component

This commit is contained in:
Insality
2020-05-04 01:12:25 +03:00
parent 75a1369997
commit 0cc848b53f
5 changed files with 52 additions and 8 deletions

View File

@@ -8,13 +8,18 @@ M["button"] = {
ENABLED_COLOR = vmath.vector4(1),
LONGTAP_TIME = 0.4,
DOUBLETAP_TIME = 0.4,
HOVER_IMAGE = "button_yellow",
HOVER_MOUSE_IMAGE = "button_yellow",
DEFAULT_IMAGE = "button_blue",
CLICK_IMAGE = "button_red",
HOVER_IMAGE = "button_red",
on_hover = function(self, node, state)
local anim = state and M.button.HOVER_IMAGE or M.button.DEFAULT_IMAGE
gui.play_flipbook(node, anim)
end,
on_mouse_hover = function(self, node, state)
local anim = state and M.button.HOVER_MOUSE_IMAGE or M.button.DEFAULT_IMAGE
gui.play_flipbook(node, anim)
end
}