Overhauled camera
This commit is contained in:
parent
5fe8f22ccb
commit
da78e7f287
21 changed files with 385 additions and 71 deletions
40
UI/Settings/Settings.gd
Normal file
40
UI/Settings/Settings.gd
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
extends Control
|
||||
|
||||
@onready var panel_container = $PanelContainer
|
||||
@onready var margin_container2 = $Pivot/MarginContainer
|
||||
|
||||
var mat: ShaderMaterial
|
||||
|
||||
func show_panel() -> void:
|
||||
margin_container2.position.y = 700
|
||||
mat.set_shader_parameter("lod", 0)
|
||||
|
||||
visible = true
|
||||
|
||||
var tween = get_tree().create_tween()
|
||||
tween.set_parallel(true)
|
||||
tween.tween_method(tween_blur, 0.0, 1.0, 0.5).set_trans(Tween.TRANS_EXPO).set_ease(Tween.EASE_IN_OUT)
|
||||
tween.tween_property(margin_container2, "position:y", 0.0, 0.5).set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_OUT)
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
mat = panel_container.material
|
||||
pass # Replace with function body.
|
||||
|
||||
func tween_blur(val: float) -> void:
|
||||
mat.set_shader_parameter("lod", val)
|
||||
pass
|
||||
|
||||
func hide_panel() -> void:
|
||||
var tween = get_tree().create_tween()
|
||||
tween.set_parallel(true)
|
||||
tween.tween_method(tween_blur, 1.0, 0.0, 0.5).set_trans(Tween.TRANS_EXPO).set_ease(Tween.EASE_IN_OUT)
|
||||
tween.tween_property(margin_container2, "position:y", 700, 0.5).set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_IN)
|
||||
|
||||
tween.finished.connect(_on_panel_hidden)
|
||||
|
||||
func _on_panel_hidden() -> void:
|
||||
visible = false
|
||||
|
||||
func _on_cancel_pressed():
|
||||
hide_panel()
|
||||
165
UI/Settings/Settings.tscn
Normal file
165
UI/Settings/Settings.tscn
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cua6l3r0yh82y"]
|
||||
|
||||
[ext_resource type="Script" path="res://UI/Settings/Settings.gd" id="1_bxt58"]
|
||||
[ext_resource type="Shader" path="res://Testbed/UIBlur.gdshader" id="1_gnf7a"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_2dtbe"]
|
||||
shader = ExtResource("1_gnf7a")
|
||||
shader_parameter/lod = 1.0
|
||||
|
||||
[node name="Settings" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_bxt58")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
self_modulate = Color(1, 1, 1, 0.392157)
|
||||
material = SubResource("ShaderMaterial_2dtbe")
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Pivot" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Pivot"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 50
|
||||
theme_override_constants/margin_top = 50
|
||||
theme_override_constants/margin_right = 50
|
||||
theme_override_constants/margin_bottom = 50
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="Pivot/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Pivot/MarginContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 15
|
||||
theme_override_constants/margin_top = 15
|
||||
theme_override_constants/margin_right = 15
|
||||
theme_override_constants/margin_bottom = 15
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TabContainer" type="TabContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="General" type="PanelContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 15
|
||||
theme_override_constants/margin_top = 15
|
||||
theme_override_constants/margin_right = 15
|
||||
theme_override_constants/margin_bottom = 15
|
||||
|
||||
[node name="General" type="VBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="HBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 15
|
||||
|
||||
[node name="Label" type="Label" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Lobby Server URL"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Button" type="Button" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Reset to default"
|
||||
|
||||
[node name="Graphics" type="PanelContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Graphics"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 15
|
||||
theme_override_constants/margin_top = 15
|
||||
theme_override_constants/margin_right = 15
|
||||
theme_override_constants/margin_bottom = 15
|
||||
|
||||
[node name="General" type="VBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="HBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/General"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 15
|
||||
|
||||
[node name="Label" type="Label" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/General/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Depth of Field Blur"
|
||||
|
||||
[node name="LineEdit" type="CheckButton" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/General/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Controls" type="PanelContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 15
|
||||
theme_override_constants/margin_top = 15
|
||||
theme_override_constants/margin_right = 15
|
||||
theme_override_constants/margin_bottom = 15
|
||||
|
||||
[node name="General" type="VBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="HBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer/General"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 15
|
||||
|
||||
[node name="Label" type="Label" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer/General/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
text = "Camera Rotation Speed"
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer/General/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
alignment = 2
|
||||
|
||||
[node name="VBoxContainer" type="HBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Save" type="Button" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Save"
|
||||
|
||||
[node name="Cancel" type="Button" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Cancel"
|
||||
|
||||
[connection signal="pressed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/VBoxContainer/Cancel" to="." method="_on_cancel_pressed"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue