Extension-Druid/example/example.gui.gui_script
Maxim Tuprikov 3996ba4b04
Feature/timer (#3)
* add timer component

* remov old components folder
2019-03-27 22:19:47 +03:00

40 lines
841 B
Plaintext

local druid = require("druid.druid")
local druid_settings = require("druid.settings")
local function setup_druid(self)
druid_settings.play_sound = function(name)
sound.play("sounds#" .. name)
end
end
function init(self)
setup_druid(self)
self.druid = druid.new(self)
self.druid:new_button("button_1", function()
print("On button 1")
end)
self.druid:new_button("button_2", function()
print("On button 2")
end)
self.druid:new_button("button_3", function()
print("On button 3")
end)
self.druid:new_timer("text_1", 0.5, 0, function()
print("On timer end")
end)
end
function update(self, dt)
self.druid:update(dt)
end
function on_message(self, message_id, message, sender)
self.druid:on_message(message_id, message, sender)
end
function on_input(self, action_id, action)
self.druid:on_input(action_id, action)
end