Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tutorials/best_practices/godot_interfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ accesses:
@onready var child = $Child

func _ready():
child.fn = funcref(self, "print_me")
child.fn = Callable(self, "print_me")
child.my_method()

func print_me():
Expand All @@ -483,7 +483,7 @@ accesses:
// Child.cs
public class Child : Node
{
public FuncRef FN = null;
public Callable FN = null;

public void MyMethod()
{
Expand All @@ -500,7 +500,7 @@ accesses:
public void _Ready()
{
Child = GetNode("Child");
Child.Set("FN", GD.FuncRef(this, "PrintMe"));
Child.Set("FN", GD.Callable(this, "PrintMe"));
Child.MyMethod();
}

Expand Down
4 changes: 2 additions & 2 deletions tutorials/best_practices/scene_organization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ initialize it:
.. code-tab:: gdscript GDScript

# Parent
$Child.func_property = funcref(object_with_method, "method_on_the_object")
$Child.func_property = Callable(object_with_method, "method_on_the_object")

# Child
func_property.call_func() # Call parent-defined method (can come from anywhere).

.. code-tab:: csharp

// Parent
GetNode("Child").Set("FuncProperty", GD.FuncRef(ObjectWithMethod, "MethodOnTheObject"));
GetNode("Child").Set("FuncProperty", GD.Callable(ObjectWithMethod, "MethodOnTheObject"));

// Child
FuncProperty.CallFunc(); // Call parent-defined method (can come from anywhere).
Expand Down