Added new HUD for bed timer
This commit is contained in:
1 parent
2bd6bc1c4e
commit
fc58d4590f
11 files changed
+190
-17
No files matched your search
+42
-12
@@ -1,22 +1,22 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://scripts/game_manager.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/UI/Menu_Recipes.png" type="Texture" id=2]
|
||||
[ext_resource path="res://assets/tutorial/machine_repair.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/Fonts/AlphaProta-Wy7VE.ttf" type="DynamicFontData" id=4]
|
||||
[ext_resource path="res://assets/UI/Timers.png" type="Texture" id=5]
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 50
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="DynamicFont" id=1]
|
||||
size = 75
|
||||
size = 55
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=3]
|
||||
bg_color = Color( 0, 0.282353, 0.721569, 1 )
|
||||
border_color = Color( 0, 0, 0, 1 )
|
||||
border_blend = true
|
||||
[sub_resource type="DynamicFont" id=3]
|
||||
size = 34
|
||||
font_data = ExtResource( 4 )
|
||||
|
||||
[node name="game_manager" type="CanvasLayer" groups=["game_manager"]]
|
||||
pause_mode = 2
|
||||
@@ -99,12 +99,21 @@ text = "MAIN MENU"
|
||||
icon_align = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="day_timer_text" type="Label" parent="UI"]
|
||||
[node name="HUD" type="TextureRect" parent="UI"]
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -747.0
|
||||
margin_top = -8.0
|
||||
margin_bottom = 137.0
|
||||
texture = ExtResource( 5 )
|
||||
|
||||
[node name="day_timer_text" type="Label" parent="UI/HUD"]
|
||||
unique_name_in_owner = true
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -520.0
|
||||
margin_bottom = 51.0
|
||||
margin_left = -198.0
|
||||
margin_top = 8.0
|
||||
margin_bottom = 84.0
|
||||
grow_horizontal = 0
|
||||
rect_pivot_offset = Vector2( 116.901, -0.362253 )
|
||||
custom_colors/font_color = Color( 0.0235294, 0.792157, 0, 1 )
|
||||
@@ -113,9 +122,30 @@ custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
|
||||
custom_constants/shadow_offset_x = -2
|
||||
custom_constants/shadow_offset_y = 2
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
custom_styles/normal = SubResource( 3 )
|
||||
text = "Time Left: 00:20"
|
||||
align = 2
|
||||
text = "00:20"
|
||||
align = 1
|
||||
valign = 1
|
||||
uppercase = true
|
||||
|
||||
[node name="current_coins_text" type="Label" parent="UI/HUD"]
|
||||
unique_name_in_owner = true
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
margin_left = -94.0
|
||||
margin_top = 95.0
|
||||
margin_right = -20.0
|
||||
margin_bottom = 130.0
|
||||
grow_horizontal = 0
|
||||
rect_pivot_offset = Vector2( 116.901, -0.362253 )
|
||||
custom_colors/font_color = Color( 0.0235294, 0.792157, 0, 1 )
|
||||
custom_colors/font_outline_modulate = Color( 0, 0, 0, 1 )
|
||||
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
|
||||
custom_constants/shadow_offset_x = -2
|
||||
custom_constants/shadow_offset_y = 2
|
||||
custom_fonts/font = SubResource( 3 )
|
||||
text = "0"
|
||||
align = 1
|
||||
valign = 1
|
||||
uppercase = true
|
||||
|
||||
[node name="day_timer" type="Timer" parent="."]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
[gd_scene load_steps=11 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/coin_machine.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scenes/item_holder.tscn" type="PackedScene" id=2]
|
||||
@@ -7,6 +7,30 @@
|
||||
[ext_resource path="res://scenes/status_light.tscn" type="PackedScene" id=5]
|
||||
[ext_resource path="res://item_types/gem.tres" type="Resource" id=6]
|
||||
[ext_resource path="res://item_types/ore.tres" type="Resource" id=7]
|
||||
[ext_resource path="res://assets/UI/Meter_Completion.png" type="Texture" id=8]
|
||||
|
||||
[sub_resource type="Shader" id=1]
|
||||
code = "shader_type canvas_item; //2D shader
|
||||
render_mode unshaded, blend_disabled; // no bells and wistles
|
||||
uniform sampler2D palette; //Uses palletes with colors in rows
|
||||
uniform float palette_count = 1.0; //Tells the shader how many palettes you have
|
||||
uniform float palette_index = 0.0; //Telss the shader which palette to choose
|
||||
|
||||
void fragment(){
|
||||
float increment = 1.0/palette_count; //Value for getting palette index
|
||||
float y = increment * palette_index + increment * 0.5; // + safety measure for floating point imprecision
|
||||
vec4 color = texture(TEXTURE, UV); //Original graysscale color used as collumn index
|
||||
vec4 new_color = texture(palette, vec2(color.r, y)); //get color from palette texture
|
||||
float a = step(0.00392, color.a); //check if transparent color is less than 1/255 for backgrounds
|
||||
new_color.a *= a; //if BG is transparent, then alpha is multiplied by 0
|
||||
|
||||
COLOR = new_color; //set new color from palette
|
||||
}"
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=2]
|
||||
shader = SubResource( 1 )
|
||||
shader_param/palette_count = 1.0
|
||||
shader_param/palette_index = 0.0
|
||||
|
||||
[node name="item_generator" type="Spatial"]
|
||||
transform = Transform( 1, 0, 3.57628e-07, 0, 1, 0, -3.57628e-07, 0, 1, 0.330428, 0, -8.57503 )
|
||||
@@ -47,6 +71,12 @@ visible = false
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
text = "Progress: 20%"
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="."]
|
||||
transform = Transform( 0.132773, 0, -1.72258e-08, 0, 0.132773, 0, -1.72258e-08, 0, 0.18094, -0.0166484, 2.48385, 2.79593 )
|
||||
material_override = SubResource( 2 )
|
||||
billboard = 1
|
||||
texture = ExtResource( 8 )
|
||||
|
||||
[connection signal="coin_requirement_met" from="coin_machine" to="." method="_on_coin_machine_coin_requirement_met"]
|
||||
[connection signal="timeout" from="gen_timer" to="." method="_on_gen_timer_timeout"]
|
||||
[connection signal="item_dump_completed" from="item_dump" to="." method="_on_item_dump_item_dump_completed"]
|
||||
Reference in new issue
Block a user