Skip to content

How to work with gd.Callable? #51

Closed Answered by Splizard
Ullanar asked this question in Q&A
Discussion options

You must be logged in to vote

You can create callables out of any Go function, ie. Callable.New(func() { fmt.Println("called from godot") }), these can take arguments too (and return a value) but you will need to know which type of arguments Godot will be passing in advance.

filter := Callable.New(func(area Area2D.Instance) bool {
    return ...
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Splizard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants