From 52659a96eeed1b3f260c4274981d450409a83b10 Mon Sep 17 00:00:00 2001 From: Insality Date: Thu, 15 May 2025 23:26:35 +0300 Subject: [PATCH] Add button to drag in drag_to_node example --- example/examples/basic/drag/drag_to_node.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example/examples/basic/drag/drag_to_node.lua b/example/examples/basic/drag/drag_to_node.lua index 61d2260..e934ea8 100644 --- a/example/examples/basic/drag/drag_to_node.lua +++ b/example/examples/basic/drag/drag_to_node.lua @@ -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