How to resize or scale a TextureButton on press?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dap404

Currently: I am using a sprite for testing and it is fairly easy to scale the sprite
ex:) set_scale(Vector2(.95, .95)

My goal: is to have the same affect on a TextureButton, I only want to use a texture_normal within it. I do not want to have to add texture_pressed textures for every button.

Any help would be great, this is pretty urgent and ive been at it for like 4 hours.
Thank you again guys!

Maybe there is a way to set texture_pressed = texture normal*.95 attributes
just brainstorming. ¯\(ツ)

dap404 | 2023-01-12 20:08

:bust_in_silhouette: Reply From: jgodfrey

You probably want to adjust the rect_scale property. So, something like:

$TextureButton.rect_scale = Vector2(2,2) # 2x scale

doesnt look like rect_scale is a thing in godot 4, or am i missing something?

dap404 | 2023-01-12 22:01

Ahhh… Sorry, missed your Godot 4 tag above. For that, I think you can set the scale property directly.

$TextureButton.scale = Vector2(2,2)

jgodfrey | 2023-01-12 22:11

:bust_in_silhouette: Reply From: dap404

you can just usescale = Vexctor2(.95,.95)

no more rect_scale and set_scale