save panel style for easy reuse

This commit is contained in:
Arnaud Vergnet 2021-04-25 00:44:17 +02:00
parent 2437814f4b
commit b1c6237824
6 changed files with 93 additions and 91 deletions

View file

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

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=9 format=2]
[ext_resource path="res://characters/Evelyne/evelyne_satisfaite.png" type="Texture" id=1]
[ext_resource path="res://characters/Patrick/Patrick sans Barbe/Pat_cool.png" type="Texture" id=2]
[ext_resource path="res://characters/Jean-Michel/Jean-Méchant.png" type="Texture" id=3]
[ext_resource path="res://backgrounds/bureauGroupe-1.jpg" type="Texture" id=4]
[ext_resource path="res://styles/Panel.tres" type="StyleBox" id=5]
[ext_resource path="res://fonts/Title.tres" type="DynamicFont" id=6]
[ext_resource path="res://scenes/MainMenu.gd" type="Script" id=7]
[ext_resource path="res://scenes/typo/Button.tscn" type="PackedScene" id=8]
@ -62,30 +63,63 @@ __meta__ = {
}
[node name="CenterContainer" type="CenterContainer" parent="MarginContainer/VBoxContainer/HBoxContainer"]
margin_right = 235.0
margin_right = 350.0
margin_bottom = 901.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer"]
margin_top = 266.0
margin_right = 235.0
margin_bottom = 634.0
[node name="Panel" type="Panel" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer"]
margin_top = 200.0
margin_right = 350.0
margin_bottom = 700.0
rect_min_size = Vector2( 350, 500 )
custom_styles/panel = ExtResource( 5 )
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_right = 20
custom_constants/margin_top = 20
custom_constants/margin_left = 20
custom_constants/margin_bottom = 20
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CenterContainer" type="CenterContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer"]
margin_left = 20.0
margin_top = 20.0
margin_right = 330.0
margin_bottom = 480.0
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer"]
margin_left = 37.0
margin_top = 46.0
margin_right = 272.0
margin_bottom = 414.0
custom_constants/separation = 20
__meta__ = {
"_edit_use_anchors_": false
}
[node name="NewGameButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer" instance=ExtResource( 8 )]
[node name="NewGameButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer" instance=ExtResource( 8 )]
margin_left = 0.0
margin_top = 0.0
margin_right = 235.0
margin_bottom = 52.0
text = "Nouvelle partie"
[node name="ContinueButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer" instance=ExtResource( 8 )]
[node name="ContinueButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer" instance=ExtResource( 8 )]
margin_left = 0.0
margin_top = 72.0
margin_right = 235.0
margin_bottom = 124.0
text = "Continuer"
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer"]
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer"]
margin_top = 144.0
margin_right = 235.0
margin_bottom = 246.0
@ -94,14 +128,14 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="CreditsButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/MarginContainer" instance=ExtResource( 8 )]
[node name="CreditsButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer" instance=ExtResource( 8 )]
margin_left = 0.0
margin_top = 50.0
margin_right = 235.0
margin_bottom = 102.0
text = "Crédits"
[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer"]
[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer"]
margin_top = 266.0
margin_right = 235.0
margin_bottom = 368.0
@ -110,7 +144,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="ExitButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/MarginContainer2" instance=ExtResource( 8 )]
[node name="ExitButton" parent="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer2" instance=ExtResource( 8 )]
margin_left = 0.0
margin_top = 50.0
margin_right = 235.0
@ -118,16 +152,16 @@ margin_bottom = 102.0
text = "Quitter"
[node name="Characters" type="Control" parent="MarginContainer/VBoxContainer/HBoxContainer"]
margin_left = 239.0
margin_left = 354.0
margin_right = 1720.0
margin_bottom = 901.0
size_flags_horizontal = 3
[node name="Patrick" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer/Characters"]
margin_left = 1059.96
margin_top = 157.77
margin_right = 1932.96
margin_bottom = 1987.77
margin_left = 781.589
margin_top = 144.3
margin_right = 1654.59
margin_bottom = 1974.3
rect_scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 2 )
flip_h = true
@ -136,10 +170,10 @@ __meta__ = {
}
[node name="Jean-Michel" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer/Characters"]
margin_left = 593.014
margin_top = 173.485
margin_right = 1466.01
margin_bottom = 2003.48
margin_left = 314.643
margin_top = 160.015
margin_right = 1187.64
margin_bottom = 1990.01
rect_scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 3 )
flip_h = true
@ -148,10 +182,10 @@ __meta__ = {
}
[node name="Evelyne" type="TextureRect" parent="MarginContainer/VBoxContainer/HBoxContainer/Characters"]
margin_left = 846.69
margin_top = 175.73
margin_right = 1719.69
margin_bottom = 2005.72
margin_left = 568.319
margin_top = 162.26
margin_right = 1441.32
margin_bottom = 1992.25
rect_scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 1 )
flip_h = true
@ -165,7 +199,7 @@ margin_right = 1720.0
margin_bottom = 1060.0
text = "Serious Game on Ethics v0.1"
align = 2
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/NewGameButton" to="." method="_on_NewGameButton_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/ContinueButton" to="." method="_on_ContinueButton_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/MarginContainer/CreditsButton" to="." method="_on_CreditsButton_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/VBoxContainer/MarginContainer2/ExitButton" to="." method="_on_ExitButton_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/NewGameButton" to="." method="_on_NewGameButton_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/ContinueButton" to="." method="_on_ContinueButton_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer/CreditsButton" to="." method="_on_CreditsButton_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/CenterContainer/Panel/MarginContainer/CenterContainer/VBoxContainer/MarginContainer2/ExitButton" to="." method="_on_ExitButton_pressed"]

View file

@ -4,24 +4,7 @@
[ext_resource path="res://images/pause.png" type="Texture" id=2]
[ext_resource path="res://scenes/typo/Button.tscn" type="PackedScene" id=3]
[ext_resource path="res://fonts/open-sans/OpenSans-Light.ttf" type="DynamicFontData" id=4]
[sub_resource type="StyleBoxFlat" id=3]
content_margin_left = 0.0
content_margin_right = 0.0
content_margin_top = 0.0
content_margin_bottom = 0.0
bg_color = Color( 0.160784, 0.152941, 0.180392, 1 )
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
shadow_color = Color( 0, 0, 0, 0.392157 )
shadow_size = 40
shadow_offset = Vector2( 10, 10 )
[ext_resource path="res://styles/Panel.tres" type="StyleBox" id=5]
[sub_resource type="DynamicFont" id=1]
size = 50
@ -71,7 +54,7 @@ margin_left = 400.0
margin_top = 100.0
margin_right = 1520.0
margin_bottom = 980.0
custom_styles/panel = SubResource( 3 )
custom_styles/panel = ExtResource( 5 )
[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/Panel"]
anchor_right = 1.0

View file

@ -13,6 +13,7 @@
[ext_resource path="res://characters/Evelyne/evelyne_satisfaite.png" type="Texture" id=11]
[ext_resource path="res://characters/Evelyne/evelyne_neutre.png" type="Texture" id=12]
[ext_resource path="res://characters/Jean-Michel/Jean-Michel_narquois.png" type="Texture" id=13]
[ext_resource path="res://styles/Panel.tres" type="StyleBox" id=14]
[sub_resource type="DynamicFont" id=1]
size = 80
@ -26,24 +27,6 @@ outline_size = 3
outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
font_data = ExtResource( 3 )
[sub_resource type="StyleBoxFlat" id=3]
content_margin_left = 0.0
content_margin_right = 0.0
content_margin_top = 0.0
content_margin_bottom = 0.0
bg_color = Color( 0.160784, 0.152941, 0.180392, 1 )
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
shadow_color = Color( 0, 0, 0, 0.392157 )
shadow_size = 40
shadow_offset = Vector2( 10, 10 )
[sub_resource type="DynamicFont" id=4]
size = 30
outline_size = 2
@ -130,7 +113,7 @@ margin_right = 1012.0
margin_bottom = 609.0
mouse_filter = 1
size_flags_horizontal = 3
custom_styles/panel = SubResource( 3 )
custom_styles/panel = ExtResource( 14 )
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/Control/RecapContainer/MarginContainer/Panel"]
anchor_right = 1.0

View file

@ -3,32 +3,15 @@
[ext_resource path="res://fonts/open-sans/OpenSans-Bold.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://fonts/open-sans/OpenSans-Regular.ttf" type="DynamicFontData" id=2]
[ext_resource path="res://scenes/end-screen/InfoPanel.gd" type="Script" id=3]
[ext_resource path="res://styles/Panel.tres" type="StyleBox" id=4]
[sub_resource type="StyleBoxFlat" id=1]
content_margin_left = 0.0
content_margin_right = 0.0
content_margin_top = 0.0
content_margin_bottom = 0.0
bg_color = Color( 0.160784, 0.152941, 0.180392, 1 )
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
shadow_color = Color( 0, 0, 0, 0.392157 )
shadow_size = 40
shadow_offset = Vector2( 10, 10 )
[sub_resource type="DynamicFont" id=2]
[sub_resource type="DynamicFont" id=1]
size = 30
outline_size = 3
outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
font_data = ExtResource( 1 )
[sub_resource type="DynamicFont" id=3]
[sub_resource type="DynamicFont" id=2]
outline_size = 1
outline_color = Color( 0.384314, 0.380392, 0.380392, 1 )
font_data = ExtResource( 2 )
@ -37,7 +20,7 @@ font_data = ExtResource( 2 )
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
custom_styles/panel = SubResource( 1 )
custom_styles/panel = ExtResource( 4 )
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
@ -65,7 +48,7 @@ mouse_filter = 2
[node name="Title" type="Label" parent="MarginContainer/VBoxContainer"]
margin_right = 1880.0
margin_bottom = 42.0
custom_fonts/font = SubResource( 2 )
custom_fonts/font = SubResource( 1 )
text = "Title"
align = 1
__meta__ = {
@ -78,7 +61,7 @@ margin_right = 1880.0
margin_bottom = 1040.0
mouse_filter = 2
size_flags_vertical = 3
custom_fonts/normal_font = SubResource( 3 )
custom_fonts/normal_font = SubResource( 2 )
text = "Content"
__meta__ = {
"_edit_use_anchors_": false

19
styles/Panel.tres Normal file
View file

@ -0,0 +1,19 @@
[gd_resource type="StyleBoxFlat" format=2]
[resource]
content_margin_left = 0.0
content_margin_right = 0.0
content_margin_top = 0.0
content_margin_bottom = 0.0
bg_color = Color( 0.160784, 0.152941, 0.180392, 1 )
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
shadow_color = Color( 0, 0, 0, 0.392157 )
shadow_size = 40
shadow_offset = Vector2( 10, 10 )