mirror of
https://github.com/Insality/druid
synced 2025-09-27 10:02:19 +02:00
Add button to drag in drag_to_node example
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user