mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
#49 add on_mouse_hover to hover component
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user