TextureButton change scale via script?

NeoBerlinNeoBerlin Posts: 106Member
edited February 16 in General Chat

Hi again,
is there a code to change the scale of a texturebutton in script?
i.e.:
button_down() -> scale up
button_up() -> scale down (back)

Thank you
Neo

Tagged:

Tags :

Answers

  • rjoshuarjoshua Posts: 37Member
    Answer ✓

    Yes, with the property rect_scale of textureButton:
    i.e.:

    extends Control
    
    
    func _on_text_button_pressed():
        $text_button.rect_scale *= 2
        #$text_button.rect_scale = Vector2(2, 2)
    
  • NeoBerlinNeoBerlin Posts: 106Member
    edited February 18

    Hi rjoshua,

    yes, i found this command, too...but i used it in the wrong way xD

    Thank you for the snipset :) Problem solved :)

    Nice day
    Neo

Sign In or Register to comment.