Skip to content

Commit

Permalink
ui themes for end_screen, buttons, experience_bar
Browse files Browse the repository at this point in the history
  • Loading branch information
KartikWatts committed Jan 27, 2024
1 parent 378ff01 commit d61d918
Show file tree
Hide file tree
Showing 8 changed files with 277 additions and 69 deletions.
40 changes: 39 additions & 1 deletion 2d-survivors-course/resources/theme/theme.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="Theme" load_steps=5 format=3 uid="uid://dppehnirbmmb0"]
[gd_resource type="Theme" load_steps=10 format=3 uid="uid://dppehnirbmmb0"]

[ext_resource type="Texture2D" uid="uid://biblk671fhhbj" path="res://assets/ui/ui.png" id="1_5h6y5"]
[ext_resource type="FontFile" uid="uid://b7708ebmlmygw" path="res://resources/theme/Rockboxcond12.ttf" id="1_8cegc"]
Expand All @@ -11,6 +11,32 @@ texture_margin_right = 4.0
texture_margin_bottom = 4.0
region_rect = Rect2(18, 2, 12, 12)

[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_buqax"]

[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_qfdxb"]
texture = ExtResource("1_5h6y5")
texture_margin_left = 3.0
texture_margin_top = 3.0
texture_margin_right = 3.0
texture_margin_bottom = 3.0
region_rect = Rect2(20, 20, 8, 8)

[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_5jl24"]
texture = ExtResource("1_5h6y5")
texture_margin_left = 3.0
texture_margin_top = 3.0
texture_margin_right = 3.0
texture_margin_bottom = 3.0
region_rect = Rect2(4, 20, 8, 8)

[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_v6dad"]
texture = ExtResource("1_5h6y5")
texture_margin_left = 3.0
texture_margin_top = 3.0
texture_margin_right = 3.0
texture_margin_bottom = 3.0
region_rect = Rect2(4, 20, 8, 8)

[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_oku1q"]
texture = ExtResource("1_5h6y5")
texture_margin_left = 4.0
Expand All @@ -19,10 +45,22 @@ texture_margin_right = 4.0
texture_margin_bottom = 10.0
region_rect = Rect2(0, 0, 16, 16)

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bkthj"]
bg_color = Color(0.247059, 0.14902, 0.192157, 1)

[resource]
default_font = ExtResource("1_8cegc")
default_font_size = 16
AlternatePanelContainer/base_type = &"PanelContainer"
AlternatePanelContainer/styles/panel = SubResource("StyleBoxTexture_uv6ji")
Button/colors/font_color = Color(0.247059, 0.14902, 0.192157, 1)
Button/colors/font_focus_color = Color(0.247059, 0.14902, 0.192157, 1)
Button/colors/font_hover_color = Color(0.741176, 0.423529, 0.290196, 1)
Button/colors/font_pressed_color = Color(0.247059, 0.14902, 0.192157, 1)
Button/styles/focus = SubResource("StyleBoxEmpty_buqax")
Button/styles/hover = SubResource("StyleBoxTexture_qfdxb")
Button/styles/normal = SubResource("StyleBoxTexture_5jl24")
Button/styles/pressed = SubResource("StyleBoxTexture_v6dad")
Label/constants/line_spacing = 0
PanelContainer/styles/panel = SubResource("StyleBoxTexture_oku1q")
ProgressBar/styles/background = SubResource("StyleBoxFlat_bkthj")
6 changes: 1 addition & 5 deletions 2d-survivors-course/scenes/game_object/player/player.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://c2o7ggmbuyq3b"]
[gd_scene load_steps=12 format=3 uid="uid://c2o7ggmbuyq3b"]

[ext_resource type="Script" path="res://scenes/game_object/player/player.gd" id="1_6ggdr"]
[ext_resource type="Texture2D" uid="uid://c3oci8ridauxg" path="res://scenes/game_object/player/player.png" id="2_1v84t"]
Expand Down Expand Up @@ -91,9 +91,6 @@ _data = {
"walk": SubResource("Animation_uo2vj")
}

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bkthj"]
bg_color = Color(0.247059, 0.14902, 0.192157, 1)

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yjt6v"]
bg_color = Color(0.262745, 0.882353, 0.701961, 1)
border_width_left = 2
Expand Down Expand Up @@ -139,7 +136,6 @@ offset_top = -23.0
offset_right = 16.0
offset_bottom = -17.0
pivot_offset = Vector2(16, 3)
theme_override_styles/background = SubResource("StyleBoxFlat_bkthj")
theme_override_styles/fill = SubResource("StyleBoxFlat_yjt6v")
max_value = 1.0
value = 0.5
Expand Down
114 changes: 57 additions & 57 deletions 2d-survivors-course/scenes/ui/ability_update_card.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,6 @@

[ext_resource type="Script" path="res://scenes/ui/ability_update_card.gd" id="1_yvp8l"]

[sub_resource type="Animation" id="Animation_o05q8"]
resource_name = "in"
length = 0.4
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:scale")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.0001, 0.15, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(1, 1), Vector2(1, 1), Vector2(1.2, 1.2), Vector2(1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}

[sub_resource type="Animation" id="Animation_eheux"]
length = 0.001
tracks/0/type = "value"
Expand Down Expand Up @@ -70,8 +41,25 @@ tracks/2/keys = {
"values": [0.0]
}

[sub_resource type="Animation" id="Animation_p8hpq"]
resource_name = "selected"
[sub_resource type="Animation" id="Animation_ek43y"]
resource_name = "discard"
length = 0.1
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:scale")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector2(1, 1), Vector2(0, 0)]
}

[sub_resource type="Animation" id="Animation_o05q8"]
resource_name = "in"
length = 0.4
step = 0.05
tracks/0/type = "value"
Expand All @@ -81,27 +69,27 @@ tracks/0/path = NodePath(".:scale")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.0001, 0.05, 0.4),
"transitions": PackedFloat32Array(1, 1, 2.07053, 1),
"times": PackedFloat32Array(0, 0.0001, 0.15, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [Vector2(1, 1), Vector2(1, 1), Vector2(1.2, 1.2), Vector2(1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:rotation")
tracks/1/path = NodePath(".:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.05, 0.2, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0, -0.174533, -0.0872665, 0.0]
"values": [Color(1, 1, 1, 1)]
}

[sub_resource type="Animation" id="Animation_ek43y"]
resource_name = "discard"
length = 0.1
[sub_resource type="Animation" id="Animation_p8hpq"]
resource_name = "selected"
length = 0.4
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
Expand All @@ -110,10 +98,22 @@ tracks/0/path = NodePath(".:scale")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"times": PackedFloat32Array(0, 0.0001, 0.05, 0.4),
"transitions": PackedFloat32Array(1, 1, 2.07053, 1),
"update": 0,
"values": [Vector2(1, 1), Vector2(0, 0)]
"values": [Vector2(1, 1), Vector2(1, 1), Vector2(1.2, 1.2), Vector2(1, 1)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.05, 0.2, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [0.0, -0.174533, -0.0872665, 0.0]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_j3573"]
Expand All @@ -124,36 +124,36 @@ _data = {
"selected": SubResource("Animation_p8hpq")
}

[sub_resource type="Animation" id="Animation_pdvbj"]
resource_name = "hover"
length = 0.2
step = 0.05
[sub_resource type="Animation" id="Animation_v555g"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:rotation")
tracks/0/interp = 2
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.05, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0, -0.0872665, 0.0872665, 0.0]
"values": [0.0]
}

[sub_resource type="Animation" id="Animation_v555g"]
length = 0.001
[sub_resource type="Animation" id="Animation_pdvbj"]
resource_name = "hover"
length = 0.2
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:rotation")
tracks/0/interp = 1
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"times": PackedFloat32Array(0, 0.05, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 0,
"values": [0.0]
"values": [0.0, -0.0872665, 0.0872665, 0.0]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_qkk8n"]
Expand Down
8 changes: 8 additions & 0 deletions 2d-survivors-course/scenes/ui/end_screen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ extends CanvasLayer
@onready var _quit_button: Button = %QuitButton
@onready var _title_label: Label = %TitleLabel
@onready var _description_label: Label = %DescriptionLabel
@onready var panel_container = %PanelContainer

func _ready():
panel_container.pivot_offset = panel_container.size/2
var tween = create_tween()
tween.tween_property(panel_container, "scale", Vector2.ZERO, 0)
tween.tween_property(panel_container, "scale", Vector2.ONE, .3)\
.set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_BACK)


get_tree().paused = true
_restart_button.pressed.connect(on_restart_button_pressed)
_quit_button.pressed.connect(on_quit_button_pressed)
Expand Down
Loading

0 comments on commit d61d918

Please sign in to comment.