- preparations for HUD

This commit is contained in:
SyntaX 2019-11-19 12:08:11 +01:00
parent 343fa46c3c
commit 9599d80b62
4 changed files with 22 additions and 16 deletions

View File

@ -35,6 +35,9 @@ func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
_lookCast = get_node(lookingAt_nodepath) as RayCast
_lookCast.cast_to = Vector3(0, 0, INTERACT_DISTANCE)
# TODO: move to Designer:
ui_interact_nodepath = get_node("HUD").get_node("PressInteract").get_path()
func _physics_process(delta):

View File

@ -1,6 +1,7 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Characters/Player/Player.gd" type="Script" id=1]
[ext_resource path="res://Characters/Player/UI/UI.tscn" type="PackedScene" id=2]
[sub_resource type="CylinderShape" id=1]
@ -27,3 +28,5 @@ cast_to = Vector3( 0, 0, 2 )
[node name="Collider" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
shape = SubResource( 1 )
[node name="HUD" parent="." instance=ExtResource( 2 )]

View File

@ -0,0 +1,14 @@
[gd_scene format=2]
[node name="HUD" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 1.948
margin_right = 1.948
[node name="PressInteract" type="Label" parent="."]
margin_left = 453.005
margin_top = 515.582
margin_right = 569.005
margin_bottom = 529.582
text = "Press E to interact"

View File

@ -34,13 +34,13 @@ extents = Vector3( 10, 1, 10 )
[node name="Player" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.634059, 0.9426, 8.83401 )
ui_interact_nodepath = NodePath("../UI/PressInteract")
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 0.766044, -0.582564, 0.271654, 0, 0.422618, 0.906308, -0.642788, -0.694272, 0.323744, 0, 5, 0 )
light_energy = 0.19
[node name="NavigationMeshInstance" type="NavigationMeshInstance" parent="."]
editor/display_folded = true
navmesh = SubResource( 1 )
[node name="MeshInstance" type="MeshInstance" parent="NavigationMeshInstance"]
@ -108,17 +108,3 @@ door_lvl = 1
transform = Transform( -2.18557e-008, 0, 0.5, 0, 0.5, 0, -0.5, 0, -2.18557e-008, -10, 1, 6 )
card_door = true
door_lvl = 1
[node name="UI" type="Control" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
[node name="PressInteract" type="Label" parent="UI"]
margin_left = 454.0
margin_top = 500.0
margin_right = 570.0
margin_bottom = 514.0
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_outline_modulate = Color( 0, 0, 0, 1 )
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
text = "Press E to interact"