@@ -2449,20 +2449,19 @@ arguments when you emit signals; it's up to you to emit the correct values.
2449
2449
2450
2450
.. image :: img/gdscript_basics_signals_node_tab_1.png
2451
2451
2452
- GDScript can bind an array of values to connections between a signal
2453
- and a method. When the signal is emitted, the callback method receives
2454
- the bound values. These bound arguments are unique to each connection,
2455
- and the values will stay the same .
2452
+ You can also create copies of GDScript Callable objects which accept additional
2453
+ arguments using :ref: ` Callable.bind() < class_Callable_method_bind >`. This
2454
+ allows you to add extra information to the connection if the emitted signal
2455
+ itself doesn't give you access to all the data that you need .
2456
2456
2457
- You can use this array of values to add extra constant information to the
2458
- connection if the emitted signal itself doesn't give you access to all the data
2459
- that you need.
2457
+ When the signal is emitted, the callback method receives the bound values, in
2458
+ addition to those provided by the signal.
2460
2459
2461
2460
Building on the example above, let's say we want to display a log of the damage
2462
2461
taken by each character on the screen, like ``Player1 took 22 damage. ``. The
2463
2462
``health_changed `` signal doesn't give us the name of the character that took
2464
2463
damage. So when we connect the signal to the in-game console, we can add the
2465
- character's name in the binds array argument ::
2464
+ character's name using the bind method ::
2466
2465
2467
2466
# game.gd
2468
2467
@@ -2472,7 +2471,7 @@ character's name in the binds array argument::
2472
2471
2473
2472
character_node.health_changed.connect(battle_log_node._on_Character_health_changed.bind(character_node.name))
2474
2473
2475
- Our ``BattleLog `` node receives each element in the binds array as an extra argument::
2474
+ Our ``BattleLog `` node receives each bound element as an extra argument::
2476
2475
2477
2476
# battle_log.gd
2478
2477
0 commit comments