mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 10:27:47 +02:00
Add button to drag in drag_to_node example
This commit is contained in:
parent
58f14d0a64
commit
52659a96ee
@ -11,6 +11,12 @@ function M:init()
|
||||
self.drag = self.druid:new_drag("drag/root", self.on_drag)
|
||||
self.drag.on_drag_end:subscribe(self.on_drag_end)
|
||||
|
||||
self.druid:new_button("drag/root", function()
|
||||
self.counter = self.counter - 1
|
||||
gui.set_text(self.text_counter, self.counter)
|
||||
self:on_drop_to_zone()
|
||||
end)
|
||||
|
||||
-- Save start position for animation
|
||||
self.start_position = gui.get_position(self.drag.node)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user