mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 10:27:47 +02:00
Add click_zone to hover
This commit is contained in:
parent
2d45573f02
commit
09dbd66484
@ -258,6 +258,7 @@ end
|
||||
-- @tparam node zone Gui node
|
||||
function M.set_click_zone(self, zone)
|
||||
self.click_zone = self:get_node(zone)
|
||||
self.hover:set_click_zone(zone)
|
||||
end
|
||||
|
||||
|
||||
|
@ -42,6 +42,9 @@ function M.on_input(self, action_id, action)
|
||||
end
|
||||
|
||||
local is_pick = gui.pick_node(self.node, action.x, action.y)
|
||||
if self.click_zone then
|
||||
is_pick = is_pick and gui.pick_node(self.click_zone, action.x, action.y)
|
||||
end
|
||||
|
||||
if not is_pick then
|
||||
M.set_hover(self, false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user