Skip to content

Commit

Permalink
Added camera help text when repositioning
Browse files Browse the repository at this point in the history
  • Loading branch information
bakana808 committed Jul 9, 2024
1 parent 0fef3c2 commit 262af8b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions project/humanized_camera_3d.gd
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ func _input(event: InputEvent) -> void:
is_repositioning = true
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
main.cam_status.visible = true
main.cam_help.visible = true
update_status()
else:
is_repositioning = false
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
base_position = position
base_rotation = rotation
main.cam_status.visible = false
main.cam_help.visible = false

if is_repositioning:
if event is InputEventMouseMotion:
Expand Down
1 change: 1 addition & 0 deletions project/main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ signal m8_scene_changed
@onready var menu: MainMenu = %MainMenuPanel

@onready var cam_status: RichTextLabel = %CameraStatus
@onready var cam_help: RichTextLabel = %CameraControls
@onready var cam_status_template: String = cam_status.text

@onready var config := M8Config.load()
Expand Down
11 changes: 11 additions & 0 deletions project/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ alignment = 1
[node name="DebugLabels" type="Control" parent="UI/MarginContainer/GridContainer/VBoxContainer"]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(0, 200)
layout_mode = 2

[node name="LabelFPS" type="Label" parent="UI/MarginContainer/GridContainer/VBoxContainer/DebugLabels"]
Expand Down Expand Up @@ -352,6 +353,16 @@ offset_top = 156.0
offset_right = 96.0
offset_bottom = 172.0

[node name="CameraControls" type="RichTextLabel" parent="UI/MarginContainer/GridContainer/VBoxContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
bbcode_enabled = true
text = "WASD Move camera
Mouse Look
MWheel Adjust focus distance"
fit_content = true

[node name="VBoxContainer2" type="VBoxContainer" parent="UI/MarginContainer/GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
Expand Down

0 comments on commit 262af8b

Please sign in to comment.