mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Input implementation progress
This commit is contained in:
@@ -15,7 +15,6 @@ M["button"] = {
|
||||
LONGTAP_TIME = 0.4,
|
||||
AUTOHOLD_TRIGGER = 0.8,
|
||||
DOUBLETAP_TIME = 0.4,
|
||||
IS_HOVER = true,
|
||||
|
||||
on_hover = function(self, node, state)
|
||||
local scale_to = self.start_scale + M.button.HOVER_SCALE
|
||||
@@ -51,6 +50,7 @@ M["scroll"] = {
|
||||
INERT_SPEED = 25, -- koef. of inert speed
|
||||
DEADZONE = 6, -- in px
|
||||
SOFT_ZONE_SIZE = 160, -- size of outside zone (back move)
|
||||
SCROLL_WHEEL_SPEED = 10,
|
||||
BACK_SPEED = 0.2, -- lerp speed
|
||||
ANIM_SPEED = 0.3, -- gui.animation speed to point
|
||||
}
|
||||
@@ -82,4 +82,29 @@ M["swipe"] = {
|
||||
}
|
||||
|
||||
|
||||
M["input"] = {
|
||||
BUTTON_SELECT_INCREASE = 1.1,
|
||||
on_select = function(self)
|
||||
local button = self.button.node
|
||||
local target_scale = self.button.start_scale
|
||||
gui.animate(button, "scale", target_scale * M.input.BUTTON_SELECT_INCREASE, gui.EASING_OUTSINE, 0.15)
|
||||
end,
|
||||
on_unselect = function(self)
|
||||
local button = self.button.node
|
||||
local start_scale = self.button.start_scale
|
||||
gui.animate(button, "scale", start_scale, gui.EASING_OUTSINE, 0.15)
|
||||
end,
|
||||
|
||||
button = {
|
||||
BTN_SOUND = "click",
|
||||
BTN_SOUND_DISABLED = "click",
|
||||
DISABLED_COLOR = vmath.vector4(0, 0, 0, 1),
|
||||
ENABLED_COLOR = vmath.vector4(1),
|
||||
LONGTAP_TIME = 0.4,
|
||||
AUTOHOLD_TRIGGER = 0.8,
|
||||
DOUBLETAP_TIME = 0.4,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return M
|
||||
|
@@ -8,7 +8,6 @@ M["button"] = {
|
||||
ENABLED_COLOR = vmath.vector4(1),
|
||||
LONGTAP_TIME = 0.4,
|
||||
DOUBLETAP_TIME = 0.4,
|
||||
IS_HOVER = false,
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user