How can I change the size of a TextureButton when Hover?

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

I am new to this engine, and I joined Brackeys game jam 2022.1.
I was trying to do some ui, when I came with the idea of making a scale animation for the TextureButton Node.

The TextureButton node doesn’t have transform. So I can’t use scale.

I did an area 2d to detect when mouse entered.

What I tried to do looks something like this:

                func _on_Area2D_mouse_entered():
                    self.set_size(21, 21)     

And gives me error.

                
:bust_in_silhouette: Reply From: CassanovaWong

try .rect_scale(Vector2(x,y))

Thank you very much!

Descubreconalex | 2022-02-23 05:32