<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Signals on Terrible Software</title>
    <link>https://terriblesoftware.dev/tags/signals/</link>
    <description>Recent content in Signals on Terrible Software</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Wed, 11 Dec 2024 09:34:12 +0800</lastBuildDate>
    <atom:link href="https://terriblesoftware.dev/tags/signals/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>TDIL: The Magic of Callable.bind in GDScript</title>
      <link>https://terriblesoftware.dev/en/posts/adding-data-to-signals-gdscript/</link>
      <pubDate>Wed, 11 Dec 2024 09:34:12 +0800</pubDate>
      <guid>https://terriblesoftware.dev/en/posts/adding-data-to-signals-gdscript/</guid>
      <description>&lt;h1 id=&#34;tdil-the-magic-of-callablebind-in-gdscript&#34;&gt;TDIL: The Magic of Callable.bind in GDScript&lt;/h1&gt;&#xA;&lt;p&gt;Today I learned (TDIL) about a super helpful feature in GDScript: Callable.bind. If you&amp;rsquo;re working with signals in Godot and find yourself needing to pass additional data to a single handler, Callable.bind is your new best friend.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-problem&#34;&gt;The Problem&lt;/h2&gt;&#xA;&lt;p&gt;In many UI setups, you might have multiple buttons that trigger the same function. However, these buttons often represent different actions or carry unique context. For example:&#xA;A list of character abilities with each button corresponding to a specific skill.&#xA;A menu system where each button navigates to a different scene or executes a unique task.&#xA;The usual approach is to connect each button&amp;rsquo;s pressed signal to the same function. But how do you tell which button triggered the signal? And what if you need to pass more data (e.g., an ID, name, or reference) to your handler?&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
