Browse Source

save panel style for easy reuse

Arnaud Vergnet 3 months ago
parent
commit
b1c6237824

+ 1
- 1
scenes/MainMenu.gd View File

@@ -2,7 +2,7 @@ extends Control
2 2
 
3 3
 var MAIN_MENU_MUSIC = "res://music/menu_principal.ogg"
4 4
 
5
-onready var exit_button = $MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/MarginContainer2/ExitButton
5
+onready var exit_button = $MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer2/ExitButton
6 6
 
7 7
 func _ready():
8 8
 	BackgroundMusic.crossfade_to(MAIN_MENU_MUSIC, -10, 1)

+ 63
- 29
scenes/MainMenu.tscn View File

@@ -1,9 +1,10 @@
1
-[gd_scene load_steps=8 format=2]
1
+[gd_scene load_steps=9 format=2]
2 2
 
3 3
 [ext_resource path="res://characters/Evelyne/evelyne_satisfaite.png" type="Texture" id=1]
4 4
 [ext_resource path="res://characters/Patrick/Patrick sans Barbe/Pat_cool.png" type="Texture" id=2]
5 5
 [ext_resource path="res://characters/Jean-Michel/Jean-Méchant.png" type="Texture" id=3]
6 6
 [ext_resource path="res://backgrounds/bureauGroupe-1.jpg" type="Texture" id=4]
7
+[ext_resource path="res://styles/Panel.tres" type="StyleBox" id=5]
7 8
 [ext_resource path="res://fonts/Title.tres" type="DynamicFont" id=6]
8 9
 [ext_resource path="res://scenes/MainMenu.gd" type="Script" id=7]
9 10
 [ext_resource path="res://scenes/typo/Button.tscn" type="PackedScene" id=8]
@@ -62,30 +63,63 @@ __meta__ = {
62 63
 }
63 64
 
64 65
 [node name="CenterContainer" type="CenterContainer" parent="MarginContainer/VBoxContainer/HBoxContainer"]
65
-margin_right = 235.0
66
+margin_right = 350.0
66 67
 margin_bottom = 901.0
68
+__meta__ = {
69
+"_edit_use_anchors_": false
70
+}
67 71
 
68
-[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer"]
69
-margin_top = 266.0
70
-margin_right = 235.0
71
-margin_bottom = 634.0
72
+[node name="Panel" type="Panel" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer"]
73
+margin_top = 200.0
74
+margin_right = 350.0
75
+margin_bottom = 700.0
76
+rect_min_size = Vector2( 350, 500 )
77
+custom_styles/panel = ExtResource( 5 )
78
+
79
+[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel"]
80
+anchor_right = 1.0
81
+anchor_bottom = 1.0
82
+size_flags_horizontal = 3
83
+size_flags_vertical = 3
84
+custom_constants/margin_right = 20
85
+custom_constants/margin_top = 20
86
+custom_constants/margin_left = 20
87
+custom_constants/margin_bottom = 20
88
+__meta__ = {
89
+"_edit_use_anchors_": false
90
+}
91
+
92
+[node name="CenterContainer" type="CenterContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer"]
93
+margin_left = 20.0
94
+margin_top = 20.0
95
+margin_right = 330.0
96
+margin_bottom = 480.0
97
+
98
+[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer"]
99
+margin_left = 37.0
100
+margin_top = 46.0
101
+margin_right = 272.0
102
+margin_bottom = 414.0
72 103
 custom_constants/separation = 20
104
+__meta__ = {
105
+"_edit_use_anchors_": false
106
+}
73 107
 
74
-[node name="NewGameButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer" instance=ExtResource( 8 )]
108
+[node name="NewGameButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer" instance=ExtResource( 8 )]
75 109
 margin_left = 0.0
76 110
 margin_top = 0.0
77 111
 margin_right = 235.0
78 112
 margin_bottom = 52.0
79 113
 text = "Nouvelle partie"
80 114
 
81
-[node name="ContinueButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer" instance=ExtResource( 8 )]
115
+[node name="ContinueButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer" instance=ExtResource( 8 )]
82 116
 margin_left = 0.0
83 117
 margin_top = 72.0
84 118
 margin_right = 235.0
85 119
 margin_bottom = 124.0
86 120
 text = "Continuer"
87 121
 
88
-[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer"]
122
+[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer"]
89 123
 margin_top = 144.0
90 124
 margin_right = 235.0
91 125
 margin_bottom = 246.0
@@ -94,14 +128,14 @@ __meta__ = {
94 128
 "_edit_use_anchors_": false
95 129
 }
96 130
 
97
-[node name="CreditsButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/MarginContainer" instance=ExtResource( 8 )]
131
+[node name="CreditsButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer" instance=ExtResource( 8 )]
98 132
 margin_left = 0.0
99 133
 margin_top = 50.0
100 134
 margin_right = 235.0
101 135
 margin_bottom = 102.0
102 136
 text = "Crédits"
103 137
 
104
-[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer"]
138
+[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer"]
105 139
 margin_top = 266.0
106 140
 margin_right = 235.0
107 141
 margin_bottom = 368.0
@@ -110,7 +144,7 @@ __meta__ = {
110 144
 "_edit_use_anchors_": false
111 145
 }
112 146
 
113
-[node name="ExitButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/MarginContainer2" instance=ExtResource( 8 )]
147
+[node name="ExitButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer2" instance=ExtResource( 8 )]
114 148
 margin_left = 0.0
115 149
 margin_top = 50.0
116 150
 margin_right = 235.0
@@ -118,16 +152,16 @@ margin_bottom = 102.0
118 152
 text = "Quitter"
119 153
 
120 154
 [node name="Characters" type="Control" parent="MarginContainer/VBoxContainer/HBoxContainer"]
121
-margin_left = 239.0
155
+margin_left = 354.0
122 156
 margin_right = 1720.0
123 157
 margin_bottom = 901.0
124 158
 size_flags_horizontal = 3
125 159
 
126 160
 [node name="Patrick" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer/Characters"]
127
-margin_left = 1059.96
128
-margin_top = 157.77
129
-margin_right = 1932.96
130
-margin_bottom = 1987.77
161
+margin_left = 781.589
162
+margin_top = 144.3
163
+margin_right = 1654.59
164
+margin_bottom = 1974.3
131 165
 rect_scale = Vector2( 0.5, 0.5 )
132 166
 texture = ExtResource( 2 )
133 167
 flip_h = true
@@ -136,10 +170,10 @@ __meta__ = {
136 170
 }
137 171
 
138 172
 [node name="Jean-Michel" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer/Characters"]
139
-margin_left = 593.014
140
-margin_top = 173.485
141
-margin_right = 1466.01
142
-margin_bottom = 2003.48
173
+margin_left = 314.643
174
+margin_top = 160.015
175
+margin_right = 1187.64
176
+margin_bottom = 1990.01
143 177
 rect_scale = Vector2( 0.5, 0.5 )
144 178
 texture = ExtResource( 3 )
145 179
 flip_h = true
@@ -148,10 +182,10 @@ __meta__ = {
148 182
 }
149 183
 
150 184
 [node name="Evelyne" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer/Characters"]
151
-margin_left = 846.69
152
-margin_top = 175.73
153
-margin_right = 1719.69
154
-margin_bottom = 2005.72
185
+margin_left = 568.319
186
+margin_top = 162.26
187
+margin_right = 1441.32
188
+margin_bottom = 1992.25
155 189
 rect_scale = Vector2( 0.5, 0.5 )
156 190
 texture = ExtResource( 1 )
157 191
 flip_h = true
@@ -165,7 +199,7 @@ margin_right = 1720.0
165 199
 margin_bottom = 1060.0
166 200
 text = "Serious Game on Ethics v0.1"
167 201
 align = 2
168
-[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/NewGameButton" to="." method="_on_NewGameButton_pressed"]
169
-[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/ContinueButton" to="." method="_on_ContinueButton_pressed"]
170
-[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/MarginContainer/CreditsButton" to="." method="_on_CreditsButton_pressed"]
171
-[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/MarginContainer2/ExitButton" to="." method="_on_ExitButton_pressed"]
202
+[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/NewGameButton" to="." method="_on_NewGameButton_pressed"]
203
+[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/ContinueButton" to="." method="_on_ContinueButton_pressed"]
204
+[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer/CreditsButton" to="." method="_on_CreditsButton_pressed"]
205
+[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer2/ExitButton" to="." method="_on_ExitButton_pressed"]

+ 2
- 19
scenes/PauseMenu.tscn View File

@@ -4,24 +4,7 @@
4 4
 [ext_resource path="res://images/pause.png" type="Texture" id=2]
5 5
 [ext_resource path="res://scenes/typo/Button.tscn" type="PackedScene" id=3]
6 6
 [ext_resource path="res://fonts/open-sans/OpenSans-Light.ttf" type="DynamicFontData" id=4]
7
-
8
-[sub_resource type="StyleBoxFlat" id=3]
9
-content_margin_left = 0.0
10
-content_margin_right = 0.0
11
-content_margin_top = 0.0
12
-content_margin_bottom = 0.0
13
-bg_color = Color( 0.160784, 0.152941, 0.180392, 1 )
14
-border_width_left = 4
15
-border_width_top = 4
16
-border_width_right = 4
17
-border_width_bottom = 4
18
-corner_radius_top_left = 10
19
-corner_radius_top_right = 10
20
-corner_radius_bottom_right = 10
21
-corner_radius_bottom_left = 10
22
-shadow_color = Color( 0, 0, 0, 0.392157 )
23
-shadow_size = 40
24
-shadow_offset = Vector2( 10, 10 )
7
+[ext_resource path="res://styles/Panel.tres" type="StyleBox" id=5]
25 8
 
26 9
 [sub_resource type="DynamicFont" id=1]
27 10
 size = 50
@@ -71,7 +54,7 @@ margin_left = 400.0
71 54
 margin_top = 100.0
72 55
 margin_right = 1520.0
73 56
 margin_bottom = 980.0
74
-custom_styles/panel = SubResource( 3 )
57
+custom_styles/panel = ExtResource( 5 )
75 58
 
76 59
 [node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/Panel"]
77 60
 anchor_right = 1.0

+ 2
- 19
scenes/end-screen/EndRecap.tscn View File

@@ -13,6 +13,7 @@
13 13
 [ext_resource path="res://characters/Evelyne/evelyne_satisfaite.png" type="Texture" id=11]
14 14
 [ext_resource path="res://characters/Evelyne/evelyne_neutre.png" type="Texture" id=12]
15 15
 [ext_resource path="res://characters/Jean-Michel/Jean-Michel_narquois.png" type="Texture" id=13]
16
+[ext_resource path="res://styles/Panel.tres" type="StyleBox" id=14]
16 17
 
17 18
 [sub_resource type="DynamicFont" id=1]
18 19
 size = 80
@@ -26,24 +27,6 @@ outline_size = 3
26 27
 outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
27 28
 font_data = ExtResource( 3 )
28 29
 
29
-[sub_resource type="StyleBoxFlat" id=3]
30
-content_margin_left = 0.0
31
-content_margin_right = 0.0
32
-content_margin_top = 0.0
33
-content_margin_bottom = 0.0
34
-bg_color = Color( 0.160784, 0.152941, 0.180392, 1 )
35
-border_width_left = 4
36
-border_width_top = 4
37
-border_width_right = 4
38
-border_width_bottom = 4
39
-corner_radius_top_left = 10
40
-corner_radius_top_right = 10
41
-corner_radius_bottom_right = 10
42
-corner_radius_bottom_left = 10
43
-shadow_color = Color( 0, 0, 0, 0.392157 )
44
-shadow_size = 40
45
-shadow_offset = Vector2( 10, 10 )
46
-
47 30
 [sub_resource type="DynamicFont" id=4]
48 31
 size = 30
49 32
 outline_size = 2
@@ -130,7 +113,7 @@ margin_right = 1012.0
130 113
 margin_bottom = 609.0
131 114
 mouse_filter = 1
132 115
 size_flags_horizontal = 3
133
-custom_styles/panel = SubResource( 3 )
116
+custom_styles/panel = ExtResource( 14 )
134 117
 
135 118
 [node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/Control/RecapContainer/MarginContainer/Panel"]
136 119
 anchor_right = 1.0

+ 6
- 23
scenes/end-screen/InfoPanel.tscn View File

@@ -3,32 +3,15 @@
3 3
 [ext_resource path="res://fonts/open-sans/OpenSans-Bold.ttf" type="DynamicFontData" id=1]
4 4
 [ext_resource path="res://fonts/open-sans/OpenSans-Regular.ttf" type="DynamicFontData" id=2]
5 5
 [ext_resource path="res://scenes/end-screen/InfoPanel.gd" type="Script" id=3]
6
+[ext_resource path="res://styles/Panel.tres" type="StyleBox" id=4]
6 7
 
7
-[sub_resource type="StyleBoxFlat" id=1]
8
-content_margin_left = 0.0
9
-content_margin_right = 0.0
10
-content_margin_top = 0.0
11
-content_margin_bottom = 0.0
12
-bg_color = Color( 0.160784, 0.152941, 0.180392, 1 )
13
-border_width_left = 4
14
-border_width_top = 4
15
-border_width_right = 4
16
-border_width_bottom = 4
17
-corner_radius_top_left = 10
18
-corner_radius_top_right = 10
19
-corner_radius_bottom_right = 10
20
-corner_radius_bottom_left = 10
21
-shadow_color = Color( 0, 0, 0, 0.392157 )
22
-shadow_size = 40
23
-shadow_offset = Vector2( 10, 10 )
24
-
25
-[sub_resource type="DynamicFont" id=2]
8
+[sub_resource type="DynamicFont" id=1]
26 9
 size = 30
27 10
 outline_size = 3
28 11
 outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
29 12
 font_data = ExtResource( 1 )
30 13
 
31
-[sub_resource type="DynamicFont" id=3]
14
+[sub_resource type="DynamicFont" id=2]
32 15
 outline_size = 1
33 16
 outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
34 17
 font_data = ExtResource( 2 )
@@ -37,7 +20,7 @@ font_data = ExtResource( 2 )
37 20
 anchor_right = 1.0
38 21
 anchor_bottom = 1.0
39 22
 mouse_filter = 2
40
-custom_styles/panel = SubResource( 1 )
23
+custom_styles/panel = ExtResource( 4 )
41 24
 script = ExtResource( 3 )
42 25
 __meta__ = {
43 26
 "_edit_use_anchors_": false
@@ -65,7 +48,7 @@ mouse_filter = 2
65 48
 [node name="Title" type="Label" parent="MarginContainer/VBoxContainer"]
66 49
 margin_right = 1880.0
67 50
 margin_bottom = 42.0
68
-custom_fonts/font = SubResource( 2 )
51
+custom_fonts/font = SubResource( 1 )
69 52
 text = "Title"
70 53
 align = 1
71 54
 __meta__ = {
@@ -78,7 +61,7 @@ margin_right = 1880.0
78 61
 margin_bottom = 1040.0
79 62
 mouse_filter = 2
80 63
 size_flags_vertical = 3
81
-custom_fonts/normal_font = SubResource( 3 )
64
+custom_fonts/normal_font = SubResource( 2 )
82 65
 text = "Content"
83 66
 __meta__ = {
84 67
 "_edit_use_anchors_": false

+ 19
- 0
styles/Panel.tres View File

@@ -0,0 +1,19 @@
1
+[gd_resource type="StyleBoxFlat" format=2]
2
+
3
+[resource]
4
+content_margin_left = 0.0
5
+content_margin_right = 0.0
6
+content_margin_top = 0.0
7
+content_margin_bottom = 0.0
8
+bg_color = Color( 0.160784, 0.152941, 0.180392, 1 )
9
+border_width_left = 4
10
+border_width_top = 4
11
+border_width_right = 4
12
+border_width_bottom = 4
13
+corner_radius_top_left = 10
14
+corner_radius_top_right = 10
15
+corner_radius_bottom_right = 10
16
+corner_radius_bottom_left = 10
17
+shadow_color = Color( 0, 0, 0, 0.392157 )
18
+shadow_size = 40
19
+shadow_offset = Vector2( 10, 10 )

Loading…
Cancel
Save