How to get a texture button texture from code

To get the button texture I am aware that I could use:

var button_texture = $some_button.texture_normal

but then if I print out button_texture, I get something like:

<CompressedTexture2D#-9223371946710792906>

What I need to get is the actual asset image I have as normal texture for the button, i.e.

“res://assets/button_picture.png”

This seems to be a recurrent issue for me. I always struggle with texture buttons and base buttons when I need to read textures.

Any tips?

Thanks!!

var button_texture = $some_button.texture_normal
var filename = button_texture.get_path()
1 Like

That easy!?!

Thanks!!! :smiley:

1 Like