mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
add text component (#4)
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
local druid = require("druid.druid")
|
||||
local druid_settings = require("druid.settings")
|
||||
|
||||
local lang = {
|
||||
locale_text = "Localized"
|
||||
}
|
||||
|
||||
local function setup_druid(self)
|
||||
druid_settings.play_sound = function(name)
|
||||
sound.play("sounds#" .. name)
|
||||
end
|
||||
|
||||
druid_settings.get_text = function(text_id)
|
||||
return lang[text_id]
|
||||
end
|
||||
end
|
||||
|
||||
function init(self)
|
||||
@@ -22,9 +30,14 @@ function init(self)
|
||||
print("On button 3")
|
||||
end)
|
||||
|
||||
self.druid:new_text("text_2", "Simple text")
|
||||
self.druid:new_text("text_3", "locale_text", true)
|
||||
|
||||
self.druid:new_timer("text_1", 0.5, 0, function()
|
||||
print("On timer end")
|
||||
end)
|
||||
|
||||
|
||||
end
|
||||
|
||||
function update(self, dt)
|
||||
|
Reference in New Issue
Block a user