mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 18:37:44 +02:00
40 lines
897 B
Plaintext
40 lines
897 B
Plaintext
local druid = require("druid.druid")
|
|
local bounce_style = require("druid.styles.bounce.style")
|
|
|
|
local main_page = require("example.kenney.page.main")
|
|
|
|
local function on_control_button(self, side)
|
|
print("Click on button side", side)
|
|
end
|
|
|
|
|
|
local function init_top_panel(self)
|
|
self.druid:new_button("button_left/button", on_control_button, "left")
|
|
self.druid:new_button("button_right/button", on_control_button, "right")
|
|
self.header = self.druid:new_text("text_header", "main_page", true)
|
|
end
|
|
|
|
|
|
function init(self)
|
|
druid.set_default_style(bounce_style)
|
|
self.druid = druid.new(self)
|
|
|
|
init_top_panel(self)
|
|
main_page.setup_page(self)
|
|
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
|