What are the use cases for Callable.bind().call(), and which parameter ordering makes more sense? #4878
nathanfranke
started this conversation in
Engine Core
Replies: 1 comment 1 reply
-
Yes, I also noticed that extends Node
@onready var texture_rect := $TextureRect as TextureRect
func _ready() -> void:
var gradient := texture_rect.texture.gradient as Gradient
var tween := create_tween().set_parallel()
var set_offset := func (offset, point): gradient.set_offset(point, offset)
tween.tween_method(set_offset.bind(1), 0.0, 0.5, 0.8)
tween.tween_method(set_offset.bind(2), 1.0, 0.5, 0.8) Maybe add a |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Edit: Proposal #4920
Current behavior when directly calling a method,
bind
s appear aftercall
parameters:I'd imagine that signals are 99% of the use case:
I consider this a weird order though. Given this method:
I would expect
hello.bind("a", "b", "c")
to return a callable that, to the engine, appears asfunc hello(d, e, f)
because those first arguments were already supplied.Here is a use case I have for having
bind
arguments first: #4868 (comment)Beta Was this translation helpful? Give feedback.
All reactions