diff options
author | Karroffel <therzog@mail.de> | 2017-08-19 15:17:06 +0200 |
---|---|---|
committer | Karroffel <therzog@mail.de> | 2017-08-19 15:22:37 +0200 |
commit | 390f7def39a6ff9a34a3a85f6b180d341b52d869 (patch) | |
tree | 8d3a5c1cd49cdc73eb9a15a91b9d2bb37c884f4b /doc/base | |
parent | 5d85108f9448ac47b871f19c8af4652b7d3dea9d (diff) |
add "propagate_call" method to Node
It is possible to propagate a notification down the Node tree by
using `propagate_notification`, but there was no such method for
doing the same but with method calls.
This commit adds the `propagate_call` method, which calls a method
on a node and all child nodes. An optional paramter `parent_first`
determines whether the parent node gets called before or after the
children have been visited. It defaults to false, so the parent
gets called last.
Diffstat (limited to 'doc/base')
-rw-r--r-- | doc/base/classes.xml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml index f21fa2c7c0..fd3e428c8b 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -26549,6 +26549,17 @@ Notify the current node and all its children recursively by calling notification() in all of them. </description> </method> + <method name="propagate_call"> + <argument index="0" name="method" type="String"> + </argument> + <argument index="1" name="args" type="Array" default="[]"> + </argument> + <argument index="2" name="parent_first" type="bool" default="false"> + </argument> + <description> + Calls the method (if present) with the arguments given in "args" on this Node and recursively on all children. If the parent_first argument is true then the method will be called on the current [Node] first, then on all children. If it is false then the children will get called first. + </description> + </method> <method name="queue_free"> <description> </description> |