mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
classref: Sync with current master branch (bdf625b)
This commit is contained in:
@@ -30,7 +30,7 @@ Description
|
||||
func test():
|
||||
var callable = Callable(self, "print_args")
|
||||
callable.call("hello", "world") # Prints "hello world ".
|
||||
callable.call(Vector2.UP, 42, callable) # Prints "(0.0, -1.0) 42 Node(node.gd)::print_args".
|
||||
callable.call(Vector2.UP, 42, callable) # Prints "(0.0, -1.0) 42 Node(node.gd)::print_args"
|
||||
callable.call("invalid") # Invalid call, should have at least 2 arguments.
|
||||
|
||||
.. code-tab:: csharp
|
||||
@@ -46,7 +46,7 @@ Description
|
||||
// Invalid calls fail silently.
|
||||
Callable callable = new Callable(this, MethodName.PrintArgs);
|
||||
callable.Call("hello", "world"); // Default parameter values are not supported, should have 3 arguments.
|
||||
callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.cs)::PrintArgs".
|
||||
callable.Call(Vector2.Up, 42, callable); // Prints "(0, -1) 42 Node(Node.cs)::PrintArgs"
|
||||
callable.Call("invalid"); // Invalid call, should have 3 arguments.
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ In GDScript, it's possible to create lambda functions within a method. Lambda fu
|
||||
var my_lambda = func (message):
|
||||
print(message)
|
||||
|
||||
# Prints Hello everyone!
|
||||
# Prints "Hello everyone!"
|
||||
my_lambda.call("Hello everyone!")
|
||||
|
||||
# Prints "Attack!", when the button_pressed signal is emitted.
|
||||
|
||||
Reference in New Issue
Block a user