Raptorkillz ok this is so easy:
first, the buttons are positioned in a linear curve, they move a fixed distance horizontally and vertically, but it would be easier to move the parent.
each button can be animated in an AnimationPlayer
, or you can use Tweens
in code.
The screen can be a video or a scene you load with the things moving though animation or code.
now, for changing between buttons, use godot's focus system, set next and previous buttons. when a button is focused it will have a signal
that is emitted. this signal is called focus_entered
, you can connect the signals of each button
to a main script, and also connect
the pressed
signal for when the button is pressed. this will work with mouse and keyboard.
In your main script, define a shift for each button in an Array of Vector2. when a button is focused, tween the parent to that shift, then call a function which will change the screen.
a good way to implement the screen is to use a tab container. toggle the option to make the tab buttons disappear and put it behind the shapes, then when a button is focused, changed to the tab of that button.
also, when a button is focused, play the animation of that button.
var shift_positions : Array[Vector2] = [Vector2(0.5, 0.7), Vector2(1.5, 1.0), Vector2(2.5, 1.3)]
var animations : Array[String] = ["options", "comp", "quit"]
@export var anim : AnimationPlayer
@export var screen_node : TabContainer
func _ready() -> void:
$button1.focus_entered.connect(move.bind(0))
$button2.focus_entered.connect(move.bind(1))
$button3.focus_entered.connect(move.bind(2))
$button1.pressed.connect(options)
$button1.pressed.connect(comp)
$button1.pressed.connect(quit)
func move(button_id : int = 0) -> void:
position = shift_positions[button_id]
anim.play(animations[button_id])
screen_node.current_tab = button_id
for the tv noise, you can call a function on the scene in the tab to display the noise for a moment.