mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Update
This commit is contained in:
@@ -33,6 +33,11 @@ function M:init()
|
||||
end
|
||||
|
||||
|
||||
function M:on_remove()
|
||||
timer.cancel(self.timer_id)
|
||||
end
|
||||
|
||||
|
||||
function M:update(dt)
|
||||
if not self.previous_time then
|
||||
self.previous_time = socket.gettime()
|
||||
|
@@ -28,6 +28,11 @@ function M:init()
|
||||
end
|
||||
|
||||
|
||||
function M:on_remove()
|
||||
timer.cancel(self.timer_id)
|
||||
end
|
||||
|
||||
|
||||
function M:set_low_memory_limit(limit)
|
||||
self.memory_limit = limit
|
||||
end
|
||||
|
@@ -39,13 +39,24 @@ function M:init()
|
||||
end
|
||||
|
||||
|
||||
function M:set_samples(samples)
|
||||
self.samples = samples
|
||||
function M:on_remove()
|
||||
self:clear()
|
||||
end
|
||||
|
||||
|
||||
function M:clear()
|
||||
self.layout:clear_layout()
|
||||
for index = 1, #self.lines do
|
||||
gui.delete_node(self.lines[index])
|
||||
end
|
||||
|
||||
self.lines = {}
|
||||
end
|
||||
|
||||
|
||||
function M:set_samples(samples)
|
||||
self.samples = samples
|
||||
self:clear()
|
||||
|
||||
local line_width = self.layout:get_size().x / self.samples
|
||||
for index = 1, self.samples do
|
||||
|
@@ -37,7 +37,7 @@ nodes {
|
||||
}
|
||||
type: TYPE_TEXT
|
||||
text: "Button"
|
||||
font: "text_bold"
|
||||
font: "druid_text_bold"
|
||||
id: "text_name"
|
||||
pivot: PIVOT_W
|
||||
outline {
|
||||
@@ -134,7 +134,7 @@ nodes {
|
||||
}
|
||||
type: TYPE_TEXT
|
||||
text: "Button"
|
||||
font: "text_bold"
|
||||
font: "druid_text_bold"
|
||||
id: "text_button"
|
||||
outline {
|
||||
x: 1.0
|
||||
|
@@ -37,7 +37,7 @@ nodes {
|
||||
}
|
||||
type: TYPE_TEXT
|
||||
text: "Checkbox"
|
||||
font: "text_bold"
|
||||
font: "druid_text_bold"
|
||||
id: "text_name"
|
||||
pivot: PIVOT_W
|
||||
outline {
|
||||
|
@@ -20,7 +20,10 @@ function M:init()
|
||||
|
||||
self.text_value = self.druid:new_text("text_value")
|
||||
self.button_left = self.druid:new_button("button_left", self.on_button_left)
|
||||
self.button_left.on_repeated_click:subscribe(self.on_button_left, self)
|
||||
|
||||
self.button_right = self.druid:new_button("button_right", self.on_button_right)
|
||||
self.button_right.on_repeated_click:subscribe(self.on_button_right, self)
|
||||
|
||||
self.on_change_value = event.create()
|
||||
|
||||
|
@@ -75,6 +75,11 @@ function M:init()
|
||||
end
|
||||
|
||||
|
||||
function M:on_remove()
|
||||
self:clear()
|
||||
end
|
||||
|
||||
|
||||
function M:on_drag_widget(dx, dy)
|
||||
local position = self.container:get_position()
|
||||
self.container:set_position(position.x + dx, position.y + dy)
|
||||
|
Reference in New Issue
Block a user