aboutsummaryrefslogtreecommitdiff
path: root/main.gd
blob: f6c1f88830a55018b1e016dfb72a78169622e902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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