Skip to content

Commit 09a7698

Browse files
committed
Implement fullscreen option
Signed-off-by: Daniel Pavela <daniel.pavela@gmail.com>
1 parent 92f4630 commit 09a7698

6 files changed

Lines changed: 140 additions & 0 deletions

File tree

Scenes/audioManager.tscn

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[gd_scene load_steps=3 format=2]
2+
3+
[ext_resource path="res://Music/intro.ogg" type="AudioStream" id=1]
4+
[ext_resource path="res://Scripts/Visualiser.gd" type="Script" id=2]
5+
6+
[node name="AudioStreamPlayer" type="AudioStreamPlayer"]
7+
stream = ExtResource( 1 )
8+
autoplay = true
9+
10+
[node name="Visualiser" type="Node2D" parent="."]
11+
script = ExtResource( 2 )

Scenes/dynamicBackground.tscn

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[gd_scene load_steps=3 format=2]
2+
3+
[ext_resource path="res://Backgrounds/Endless-shapes.jpg" type="Texture" id=5]
4+
[ext_resource path="res://Scripts/dyanmicBackground.gd" type="Script" id=6]
5+
6+
[node name="background" type="MarginContainer"]
7+
anchor_right = 1.0
8+
anchor_bottom = 1.0
9+
custom_constants/margin_right = 120
10+
custom_constants/margin_top = 80
11+
custom_constants/margin_left = 102
12+
custom_constants/margin_bottom = 80
13+
__meta__ = {
14+
"_edit_use_anchors_": false
15+
}
16+
17+
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
18+
script = ExtResource( 6 )
19+
20+
[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"]
21+
z_index = -2
22+
23+
[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"]
24+
scale = Vector2( 0.6, 0.6 )
25+
z_index = -2
26+
texture = ExtResource( 5 )
27+
centered = false
28+
offset = Vector2( -30, -30 )

Scenes/optionsMenu.tscn

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
[gd_scene load_steps=8 format=2]
2+
3+
[ext_resource path="res://Fonts/NotoSans/NotoSans-Regular.ttf" type="DynamicFontData" id=1]
4+
[ext_resource path="res://Scenes/dynamicBackground.tscn" type="PackedScene" id=2]
5+
[ext_resource path="res://Scripts/UI/returnToTitle.gd" type="Script" id=3]
6+
[ext_resource path="res://Scripts/UI/fullscreenCheck.gd" type="Script" id=4]
7+
8+
[sub_resource type="DynamicFont" id=1]
9+
size = 60
10+
font_data = ExtResource( 1 )
11+
12+
[sub_resource type="DynamicFont" id=2]
13+
size = 35
14+
font_data = ExtResource( 1 )
15+
16+
[sub_resource type="DynamicFont" id=3]
17+
size = 35
18+
font_data = ExtResource( 1 )
19+
20+
[node name="MarginContainer" type="MarginContainer"]
21+
anchor_right = 1.0
22+
anchor_bottom = 1.0
23+
custom_constants/margin_right = 120
24+
custom_constants/margin_top = 80
25+
custom_constants/margin_left = 120
26+
custom_constants/margin_bottom = 80
27+
__meta__ = {
28+
"_edit_use_anchors_": false
29+
}
30+
31+
[node name="HBoxContainer" type="HBoxContainer" parent="."]
32+
margin_left = 120.0
33+
margin_top = 80.0
34+
margin_right = 904.0
35+
margin_bottom = 520.0
36+
37+
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
38+
margin_right = 368.0
39+
margin_bottom = 440.0
40+
41+
[node name="Title" type="Label" parent="HBoxContainer/VBoxContainer"]
42+
margin_right = 368.0
43+
margin_bottom = 83.0
44+
custom_fonts/font = SubResource( 1 )
45+
text = "Options"
46+
47+
[node name="MenuOptions" type="VBoxContainer" parent="HBoxContainer/VBoxContainer"]
48+
margin_top = 87.0
49+
margin_right = 368.0
50+
margin_bottom = 381.0
51+
size_flags_vertical = 3
52+
custom_constants/separation = 20
53+
alignment = 1
54+
55+
[node name="CheckBox" type="CheckBox" parent="HBoxContainer/VBoxContainer/MenuOptions"]
56+
margin_top = 80.0
57+
margin_right = 368.0
58+
margin_bottom = 137.0
59+
custom_fonts/font = SubResource( 2 )
60+
text = "Fullscreen"
61+
flat = true
62+
script = ExtResource( 4 )
63+
64+
[node name="CheckBox2" type="CheckBox" parent="HBoxContainer/VBoxContainer/MenuOptions"]
65+
margin_top = 157.0
66+
margin_right = 368.0
67+
margin_bottom = 214.0
68+
custom_fonts/font = SubResource( 2 )
69+
text = "Music"
70+
flat = true
71+
72+
[node name="Button" type="Button" parent="HBoxContainer/VBoxContainer"]
73+
margin_top = 385.0
74+
margin_right = 368.0
75+
margin_bottom = 440.0
76+
custom_fonts/font = SubResource( 3 )
77+
text = "Return to Title Screen"
78+
script = ExtResource( 3 )
79+
80+
[node name="background" parent="." instance=ExtResource( 2 )]
81+
visible = false
82+
anchor_right = 0.0
83+
anchor_bottom = 0.0
84+
margin_left = 120.0
85+
margin_top = 80.0
86+
margin_right = 904.0
87+
margin_bottom = 520.0

Scripts/UI/Options.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extends Button
2+
3+
# Called when the button attached to this script is pressed
4+
func _pressed():
5+
get_tree().change_scene("res://Scenes/optionsMenu.tscn")

Scripts/UI/fullscreenCheck.gd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
extends CheckBox
2+
3+
func _toggled(state):
4+
OS.window_fullscreen = state

Scripts/UI/returnToTitle.gd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extends Button
2+
3+
# Called when the button attached to this script is pressed
4+
func _pressed():
5+
get_tree().change_scene("res://Scenes/titleScreen.tscn")

0 commit comments

Comments
 (0)