fun
This commit is contained in:
parent
5cfdd34e96
commit
13ccecad19
25 changed files with 730 additions and 53 deletions
50
Player/GUI/GUI.tscn
Normal file
50
Player/GUI/GUI.tscn
Normal file
|
@ -0,0 +1,50 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://b6rvghqqnqqk1"]
|
||||
|
||||
[ext_resource type="Script" path="res://Player/GUI/GuiRoot.gd" id="1_hovww"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_nvd2b"]
|
||||
font_size = 32
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer"]
|
||||
|
||||
[node name="GuiRoot" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_hovww")
|
||||
|
||||
[node name="Velocity" type="Label" parent="GuiRoot"]
|
||||
layout_mode = 0
|
||||
offset_right = 79.0
|
||||
offset_bottom = 23.0
|
||||
text = "Velocity: 0"
|
||||
label_settings = SubResource("LabelSettings_nvd2b")
|
||||
|
||||
[node name="HorzVeloc" type="Label" parent="GuiRoot"]
|
||||
layout_mode = 0
|
||||
offset_top = 44.0
|
||||
offset_right = 328.0
|
||||
offset_bottom = 89.0
|
||||
text = "Horizontal Velocity: 0"
|
||||
label_settings = SubResource("LabelSettings_nvd2b")
|
||||
|
||||
[node name="VertVeloc" type="Label" parent="GuiRoot"]
|
||||
layout_mode = 0
|
||||
offset_top = 88.0
|
||||
offset_right = 283.0
|
||||
offset_bottom = 133.0
|
||||
text = "Vertical Velocity: 0"
|
||||
label_settings = SubResource("LabelSettings_nvd2b")
|
||||
|
||||
[node name="AddedVeloc" type="Label" parent="GuiRoot"]
|
||||
layout_mode = 0
|
||||
offset_top = 132.0
|
||||
offset_right = 283.0
|
||||
offset_bottom = 177.0
|
||||
text = "Added Velocity: 0"
|
||||
label_settings = SubResource("LabelSettings_nvd2b")
|
5
Player/GUI/GuiController.gd
Normal file
5
Player/GUI/GuiController.gd
Normal file
|
@ -0,0 +1,5 @@
|
|||
extends Control
|
||||
#
|
||||
#func _process(delta):
|
||||
#position = -get_viewport_transform().get_origin()
|
||||
#print(position)
|
13
Player/GUI/GuiRoot.gd
Normal file
13
Player/GUI/GuiRoot.gd
Normal file
|
@ -0,0 +1,13 @@
|
|||
extends Control
|
||||
|
||||
@onready var player = $"../../"
|
||||
|
||||
@onready var velocNumb = $"Velocity"
|
||||
@onready var horzVeloc = $"HorzVeloc"
|
||||
@onready var vertVeloc = $"VertVeloc"
|
||||
@onready var addedVeloc = $"AddedVeloc"
|
||||
func _physics_process(delta):
|
||||
velocNumb.text = "Velocity: " + str(round(player.velocity.length()))
|
||||
horzVeloc.text = "Horizontal Velocity: " + str(round(abs(player.velocity.x)))
|
||||
vertVeloc.text = "Vertical Velocity: " + str(round(abs(player.velocity.y)))
|
||||
addedVeloc.text = "Added Velocity: " + str(round(abs(player.addedveloc)))
|
Loading…
Add table
Add a link
Reference in a new issue