23 lines
822 B
GDScript
23 lines
822 B
GDScript
extends PanelContainer
|
|
|
|
var elapsed_time = 0.0 # Initialize a variable to keep track of elapsed time
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
pass # Replace with function body.
|
|
|
|
func _process(delta):
|
|
elapsed_time += delta # Increment the elapsed time by the frame's delta time
|
|
var hours = int(elapsed_time / 3600)
|
|
var minutes = int(elapsed_time / 60) % 60
|
|
var seconds = int(elapsed_time) % 60
|
|
var time_string = "%02d:%02d:%02d" % [hours, minutes, seconds] # Format time as H:M:S
|
|
var fps = Engine.get_frames_per_second() # Get the current FPS
|
|
$HBoxContainer/Debug.text = time_string+" "+str(fps) + " fps" # Combine FPS and runtime into one string
|
|
|
|
func _on_save_pressed():
|
|
$"../SaveDialog".popup_centered()
|
|
|
|
func _on_load_pressed():
|
|
$"../LoadDialog".popup_centered()
|