-
Notifications
You must be signed in to change notification settings - Fork 1
/
debugControls.gd
58 lines (40 loc) · 1.67 KB
/
debugControls.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
extends Control
onready var debugInter = $debugInterface
onready var braidShader = $Effects/BraidRing;
func _on_hideGuiButton_toggled(button_pressed):
if button_pressed:
$".".remove_child(debugInter)
else:
$".".add_child(debugInter)
func _on_circleSizeSlider_value_changed(val):
braidShader.material.set_shader_param("circleSize", val)
func _on_frequencySlider_value_changed(val):
braidShader.material.set_shader_param("frequency", val)
func _on_zoomPower_value_changed(val):
braidShader.material.set_shader_param("zoomPower", val)
func _on_depthtMult_value_changed(val):
braidShader.material.set_shader_param("depth", val)
#TODO: if you want, add pulsePercent and borderLimit sliders
#images and shader selection. already present in the example
func _ready():
for c in $Pictures.get_children():
$debugInterface/Picture.add_item("PIC: " + c.get_name())
for c in $Effects.get_children():
$debugInterface/Effect.add_item("FX: " + c.get_name())
$Pictures.get_child(1).show()
$debugInterface/circleSizeSlider.value = braidShader.material.get_shader_param("circleSize");
$debugInterface/frequencySlider.value = braidShader.material.get_shader_param("frequency");
$debugInterface/zoomPower.value = braidShader.material.get_shader_param("zoomPower");
$debugInterface/depthtMult.value = braidShader.material.get_shader_param("depth");
func _on_picture_item_selected(ID):
for c in range($Pictures.get_child_count()):
if ID == c:
$Pictures.get_child(c).show()
else:
$Pictures.get_child(c).hide()
func _on_effect_item_selected(ID):
for c in range($Effects.get_child_count()):
if ID == c:
$Effects.get_child(c).show()
else:
$Effects.get_child(c).hide()