aboutsummaryrefslogtreecommitdiff
path: root/main.gd
diff options
context:
space:
mode:
authordam <dam@gudinoff>2021-12-01 02:26:44 +0000
committerdam <dam@gudinoff>2021-12-01 02:26:44 +0000
commit2e5c0de21b0f35531e3d42e63c27df80cf3fad02 (patch)
tree8874e7942f1a5fa0173784c1ff04558703e53d7d /main.gd
parent697e1ba3c4cb0a96c4584f1553de368d46287ab7 (diff)
downloadsurgery-log-2e5c0de21b0f35531e3d42e63c27df80cf3fad02.tar.zst
surgery-log-2e5c0de21b0f35531e3d42e63c27df80cf3fad02.zip
Convert from native to godot
Diffstat (limited to 'main.gd')
-rw-r--r--main.gd38
1 files changed, 38 insertions, 0 deletions
diff --git a/main.gd b/main.gd
new file mode 100644
index 0000000..f6c1f88
--- /dev/null
+++ b/main.gd
@@ -0,0 +1,38 @@
+extends Control
+
+
+# Declare member variables here. Examples:
+# var a = 2
+# var b = "text"
+var _timeout: float
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+ $output.text = "Hello!"
+ $button.connect("pressed", self, "_pressed")
+
+
+func _process(delta: float):
+ $output.text = "%s" % Engine.get_frames_per_second()
+ $timer.text = "%s" % _timeout
+ if _timeout > 0.0:
+ _timeout -= delta
+ else:
+ Engine.target_fps = 10.0
+
+func _pressed():
+ $log.text += "PRESSED\n"
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+#func _process(delta):
+# pass
+
+
+func _input(event):
+ Engine.target_fps = 0
+ _timeout = 5.0
+
+
+func _unhandled_input(event):
+ Engine.target_fps = 0
+ _timeout = 5.0