Skip to content

Instantly share code, notes, and snippets.

@BrastenXBL
Created March 31, 2025 04:21
Show Gist options
  • Save BrastenXBL/c044eeb114735085791572b89c2f5af8 to your computer and use it in GitHub Desktop.
Save BrastenXBL/c044eeb114735085791572b89c2f5af8 to your computer and use it in GitHub Desktop.
ScrollingBackground Menu Godot 4.4
[gd_scene load_steps=3 format=3]
[sub_resource type="Gradient" id="Gradient_55y5s"]
offsets = PackedFloat32Array(0, 0.498411, 1)
colors = PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_7yxsr"]
gradient = SubResource("Gradient_55y5s")
width = 960
height = 540
fill_from = Vector2(0.5, 0)
fill_to = Vector2(0.5, 1)
[node name="ScrollingBackground" type="Node"]
[node name="GameMenu" type="CanvasLayer" parent="."]
layer = 100
[node name="VBoxContainer" type="VBoxContainer" parent="GameMenu"]
anchors_preset = -1
anchor_left = 0.4
anchor_top = 0.4
anchor_right = 0.6
anchor_bottom = 0.9
grow_horizontal = 2
grow_vertical = 2
[node name="Button" type="Button" parent="GameMenu/VBoxContainer"]
layout_mode = 2
text = "Continue"
[node name="Button2" type="Button" parent="GameMenu/VBoxContainer"]
layout_mode = 2
text = "New Game"
[node name="Button3" type="Button" parent="GameMenu/VBoxContainer"]
layout_mode = 2
text = "Settings"
[node name="Button4" type="Button" parent="GameMenu/VBoxContainer"]
layout_mode = 2
text = "Exit"
[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = -100
[node name="Timer" type="Timer" parent="CanvasLayer"]
wait_time = 2.0
one_shot = true
autostart = true
[node name="Parallax2D" type="Parallax2D" parent="CanvasLayer"]
repeat_size = Vector2(0, 2160)
[node name="TextureRect" type="TextureRect" parent="CanvasLayer/Parallax2D"]
offset_right = 1920.0
offset_bottom = 2160.0
texture = SubResource("GradientTexture2D_7yxsr")
expand_mode = 1
[connection signal="timeout" from="CanvasLayer/Timer" to="CanvasLayer/Parallax2D" method="set_autoscroll" binds= [Vector2(0, 100)]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment