mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
#111 Add druid.stencil_check for auto stencil check to call set_click_zone
This commit is contained in:
@@ -23,7 +23,7 @@ end
|
||||
function M.update(self, dt)
|
||||
end
|
||||
|
||||
-- Call only if exist interest: component.ON_INPUT or component.ON_INPUT_HIGH
|
||||
-- Call only if exist interest: component.ON_INPUT
|
||||
function M.on_input(self, action_id, action)
|
||||
end
|
||||
|
||||
@@ -60,6 +60,10 @@ end
|
||||
function M.on_focus_gained(self)
|
||||
end
|
||||
|
||||
-- Call only if exist interest: component.ON_LATE_INIT
|
||||
function M.on_late_init(self)
|
||||
end
|
||||
|
||||
-- Call on component remove or on druid:final
|
||||
function M.on_remove(self)
|
||||
end
|
||||
@@ -117,6 +121,8 @@ There is next interests in druid:
|
||||
|
||||
- **ON_FOCUS_GAINED** will call _on_focust_gained_ function in on focus gained event. You need to pass window_callback to global `druid:on_window_callback`
|
||||
|
||||
- **ON_LATE_INIT** will call _on_late_init_ function once after component init on update step.
|
||||
|
||||
## Best practice on custom components
|
||||
On each component recommended describe component scheme in next way:
|
||||
|
||||
|
@@ -237,4 +237,8 @@ Have a good day.
|
||||
- `value` - optional field for several actions. For example value is text for **TEXT_SET**
|
||||
- Add Druid component interest: `component.ON_MESSAGE_INPUT`
|
||||
- Implement new interest via function `component:on_message_input(node_id, message)`
|
||||
- See **System: Message input** example
|
||||
- See **System: Message input** example
|
||||
- **#111**: Add autocheck for input and stencil nodes. To enable this feature, add `druid.stencil_check = 1` to your game.project file.
|
||||
- Add `helper.get_closest_stencil_node` function to get closest parent non inverted stencil node
|
||||
- Add `component.ON_LATE_INIT` interest. If component with with interest, it will call `component.on_late_init` function once after component init on update step. This can be used to do something after all gui components are was initialized and setup.
|
||||
- This feature is using for auto setup `component:set_click_zone` to restrict clicks outside scrolls zone for example. Now you can don't think about click zone and let Druid do it instead of you!
|
Reference in New Issue
Block a user