-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexample.gd
30 lines (26 loc) · 1.27 KB
/
example.gd
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
extends Control
onready var monitor = $Monitor
func _ready():
# draws OS time between frames, not interpolated
monitor.os_time_per_frame()
# # add_perf_monitor adds anything from Performance Godot object
# monitor.add_perf_monitor(Performance.TIME_PROCESS, "Time process, s",
# Color(0.2, 0.6, 0.95, 0.4), false, false, 0.0)
# monitor.add_perf_monitor(Performance.TIME_FPS, "FPS")
# monitor.add_perf_monitor(Performance.MEMORY_DYNAMIC, "Dyn mem",
# Color(0.8, 0.7, 0.2, 0.4), true)
# monitor.add_perf_monitor(Performance.MEMORY_STATIC, "Stat mem",
# Color(0.2, 0.5, 0.8, 0.4), true, 360)
#
# var render_info_funcref: FuncRef = funcref(VisualServer, "get_render_info")
## monitor.add_funcref_monitor(render_info_funcref, [VisualServer.INFO_TEXTURE_MEM_USED],
## "Texture mem", Color(0.9, 0.9, 0.9, 0.6), true)
#
# # consider, that by default each monitor has 180 draw calls in this unoptimized version
# monitor.add_funcref_monitor(render_info_funcref, [VisualServer.INFO_2D_DRAW_CALLS_IN_FRAME],
# "Draw calls", Color(0.2, 0.5, 0.8, 0.4))
#
# # if we had a Player node we could add something like that provided
# # - $Player is already initialized
# # - $Player has "hitpoints" attribute, which is either float or int
# monitor.add_custom_monitor($Player, "hitpoints", "Player hp")