Godot Version
4.4
Question
I’m creating a custom signal, and its argument is a Texture2D
:
public partial class Node3d : Node3D
{
Texture2D sprite;
[Signal] public delegate void eventIdleEventHandler(Texture2D texture);
void SetTexture(Texture2D _spr)
{
sprite = _spr;
}
}
In the editor I can assign functions to be called when this signal is invoked, and I also have the option to Add Extra Call Argument (if the Advanced option is toggled).
My issue is that I can’t add an argument that is of type Texture2D
from the UI. However I can add an array argument, add one value and make that value a Object
that in turn can be interpreted as a Texture2D
.
So I’m wondering whether this is a bug in the editor, or if there is a workaround for this.
Left image: Argument types (No Object
type)
Right image: Array element types (With Object
type)
Bottom image: Current setup with an array of one Object
interpreted as a Texture2D
(Note: The example is fictional, and the scripting language should be irrelevant in this context)