Smoother cursor, Viewport scale, Stats

This commit is contained in:
2025-06-29 22:19:02 +03:00
parent bdde71f829
commit e2cc40266b
6 changed files with 66 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=3 format=3 uid="uid://cdeww5uc20038"]
[gd_scene load_steps=3 format=3 uid="uid://c42ny2e8vbhhc"]
[ext_resource type="Script" uid="uid://ccydu80643k4s" path="res://Scripts/CursorScript.gd" id="1_uu6xs"]
[ext_resource type="Texture2D" uid="uid://d0hckoql2xnbq" path="res://Textures/svg/Cursor.svg" id="2_r0du0"]

View File

@@ -20,7 +20,8 @@ func _process(delta: float) -> void:
mouse_velocity = current_mouse_pos - old_mouse_pos
if mouse_velocity.length_squared()>0.1:
rotation = mouse_velocity.angle()
rotation = lerp_angle(rotation, mouse_velocity.angle(), 80 * delta)
var direction_to_mouse = (current_mouse_pos - global_position).normalized()
global_position = current_mouse_pos

View File

@@ -11,5 +11,12 @@ config_version=5
[application]
config/name="2D-Beatsaber-ig"
run/main_scene="uid://dc02h0h7ooucv"
config/features=PackedStringArray("4.4", "Forward Plus")
config/icon="res://icon.svg"
[display]
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"
window/vsync/vsync_mode=0

40
game/testGround.tscn Normal file
View File

@@ -0,0 +1,40 @@
[gd_scene load_steps=3 format=3 uid="uid://dc02h0h7ooucv"]
[ext_resource type="Script" uid="uid://hfccs84dimkv" path="res://test_ground.gd" id="1_85h15"]
[ext_resource type="PackedScene" uid="uid://c42ny2e8vbhhc" path="res://Cursor.tscn" id="1_rkps0"]
[node name="Screen" type="CanvasLayer"]
script = ExtResource("1_85h15")
[node name="Cursor" parent="." instance=ExtResource("1_rkps0")]
position = Vector2(263, 291)
[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -131.0
offset_right = 134.0
grow_vertical = 0
size_flags_vertical = 8
metadata/_edit_use_anchors_ = true
[node name="Label" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Info?"
[node name="Fps" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "FPS : "
[node name="Frametime" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "FrameTimeMCS :"
[node name="PT" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Procces Time: "
[node name="VideoMemory" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Video Mem:"

15
game/test_ground.gd Normal file
View File

@@ -0,0 +1,15 @@
extends CanvasLayer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
$VBoxContainer/Fps.text = "FPS: " + str(Performance.get_monitor(Performance.TIME_FPS))
$VBoxContainer/Frametime.text = "FrameTime: " + str(Engine.get_physics_interpolation_fraction())
$VBoxContainer/PT.text = "Process time: "+ str(Performance.get_monitor(Performance.TIME_PROCESS))
$VBoxContainer/VideoMemory.text ="Video memory Used: " + str(Performance.get_monitor(Performance.RENDER_VIDEO_MEM_USED))
pass

1
game/test_ground.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://hfccs84dimkv