Hi,
recently started using this game creation platform. I’m creating 50 buttons for 50 levels, each with a unique texture. I’m using ‘texturebutton’ but I’m having trouble animating the buttons, like changing them when you hover or click. I tried using ‘themes’ but didn’t get it. I know I could use code, but having 50 scripts seems like a nightmare. And in the future how to make it in simple ways to not mess with it.
What do mean when you say
animating the buttons, like changing them when you hover or click
Buttons have signals such as mouse_entered
or pressed
which you can use to animate the buttons.
Does the “changing” involve changing things in the theme?
If yes, then you can just override the theme in the code.
(Make the Theme Unique for the button first so it only applies to the specific button and not all of them)
If it’s simple things like position or scale, you can do it straight there.
The easiest and funniest thing you can do for now is to make the button wobble on mouse_hover
func _on_button_mouse_hover() -> void:
var tween = create_tween().set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_ELASTIC)
tween.tween_property(your_button, "scale", Vector2(1.1, 1.1), 1.0)