mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 10:27:47 +02:00
Fix test.ini
This commit is contained in:
parent
e8dbc097d0
commit
6e4490a3a7
@ -1,26 +0,0 @@
|
|||||||
-- Copyright (c) 2021 Maksim Tuprikov <insality@gmail.com>. This code is licensed under MIT license
|
|
||||||
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
|
|
||||||
M["button"] = {
|
|
||||||
LONGTAP_TIME = 0.4,
|
|
||||||
DOUBLETAP_TIME = 0.4,
|
|
||||||
|
|
||||||
HOVER_MOUSE_IMAGE = "button_yellow",
|
|
||||||
DEFAULT_IMAGE = "button_blue",
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return M
|
|
@ -1,5 +1,4 @@
|
|||||||
local druid = require("druid.druid")
|
local druid = require("druid.druid")
|
||||||
local sprite_style = require("druid.styles.sprites.style")
|
|
||||||
|
|
||||||
|
|
||||||
local function usual_callback()
|
local function usual_callback()
|
||||||
@ -52,9 +51,6 @@ end
|
|||||||
local function setup_buttons(self)
|
local function setup_buttons(self)
|
||||||
self.druid:new_button("button_usual/button", usual_callback)
|
self.druid:new_button("button_usual/button", usual_callback)
|
||||||
|
|
||||||
local custom_style = self.druid:new_button("button_custom_style/button", usual_callback)
|
|
||||||
custom_style:set_style(sprite_style)
|
|
||||||
|
|
||||||
local long_button = self.druid:new_button("button_long_tap/button", usual_callback)
|
local long_button = self.druid:new_button("button_long_tap/button", usual_callback)
|
||||||
long_button.on_hold_callback:subscribe(hold_callback)
|
long_button.on_hold_callback:subscribe(hold_callback)
|
||||||
long_button.on_long_click:subscribe(long_tap_callback)
|
long_button.on_long_click:subscribe(long_tap_callback)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user