classes/class_callable #225
Replies: 3 comments 1 reply
-
To create a Callable with parameters in C# the only option is to use lamda. Example: Source Godot Issue #68752 |
Beta Was this translation helpful? Give feedback.
0 replies
-
First gdscript example after description uses |
Beta Was this translation helpful? Give feedback.
1 reply
-
C++ Example with arguments (for now v4.4 works only with class methods): //Method to call
void PlayerCPP::SetForceCanJump(bool Can)
{
ForceCanJump = Can;
}
//..create callable somewhere in PlayerCPP class
Callable C(callable_mp(this, &PlayerCPP::SetForceCanJump));
Array A; A.append(true);
C = C.callv(A);
//Use C as you need, for example with tween
Ref<Tween> XTween = get_tree()->create_tween();
XTween->tween_callback(C); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
classes/class_callable
A built-in type representing a method or a standalone function. Description: Callable is a built-in Variant type that represents a function. It can either be a method within an Object instance, or ...
https://docs.godotengine.org/en/stable/classes/class_callable.html
Beta Was this translation helpful? Give feedback.
All reactions