mirror of
https://github.com/Insality/druid
synced 2025-09-27 10:02:19 +02:00
Update
This commit is contained in:
@@ -16,7 +16,7 @@ local component = require("druid.component")
|
||||
---@field on_mouse_hover fun(self, node, hover_state)|nil
|
||||
---@field on_set_enabled fun(self, node, enabled_state)|nil
|
||||
|
||||
---Clickable node with various interaction callbacks
|
||||
---Druid component to make clickable node with various interaction callbacks
|
||||
---@class druid.button: druid.component
|
||||
---@field on_click event function(self, custom_args, button_instance)
|
||||
---@field on_pressed event function(self, custom_args, button_instance)
|
||||
@@ -218,7 +218,7 @@ end
|
||||
|
||||
---Set additional button click area.
|
||||
---Useful to restrict click outside out stencil node or scrollable content.
|
||||
---This functions calls automatically if you don't disable it in game.project: druid.no_stencil_check
|
||||
---If button node placed inside stencil node, it will be automatically set to this stencil node.
|
||||
---@param zone node|string|nil Gui node
|
||||
---@return druid.button self
|
||||
function M:set_click_zone(zone)
|
||||
|
@@ -89,6 +89,7 @@ local WRAPPED_WIDGETS = {}
|
||||
|
||||
---Set a widget to the current game object. The game object can acquire the widget by calling `bindings.get_widget`
|
||||
---It wraps with events only top level functions cross-context, so you will have no access to nested widgets functions
|
||||
---Only one widget can be set per game object.
|
||||
---@param widget druid.widget
|
||||
function M.set_widget(widget)
|
||||
local object = msg.url()
|
||||
@@ -113,6 +114,7 @@ function M.set_widget(widget)
|
||||
end
|
||||
|
||||
|
||||
---Get a binded widget to the current game object.
|
||||
---@param object_url string|userdata|url|nil Root object, if nil current object will be used
|
||||
---@return druid.widget|nil
|
||||
function M.get_widget(object_url)
|
||||
|
Reference in New Issue
Block a user