Hide receptors inside menu

This commit is contained in:
Luke Hubmayer-Werner 2021-01-05 00:03:36 +10:30
parent 23dd718843
commit 75759659ee
3 changed files with 9 additions and 0 deletions

View File

@ -99,9 +99,12 @@ script = ExtResource( 3 )
[node name="Receptors" type="MeshInstance2D" parent="."]
material = SubResource( 1 )
position = Vector2( 0, 1080 )
mesh = SubResource( 2 )
script = ExtResource( 5 )
[node name="Tween" type="Tween" parent="Receptors"]
[node name="NoteHandler" type="Node2D" parent="."]
script = ExtResource( 6 )

View File

@ -385,6 +385,7 @@ func _draw():
ScoreText.show()
func set_menu_mode(mode):
$'../Receptors'.fade(mode == MenuMode.GAMEPLAY)
menu_mode_prev = menu_mode
menu_mode = mode
menu_mode_prev_fade_timer = menu_mode_prev_fade_timer_duration

View File

@ -147,3 +147,8 @@ func _ready():
# if not Engine.editor_hint:
# set_receptor_positions(sin(OS.get_ticks_msec()*0.001*0.0125*PI)*PI)
# update()
func fade(visible: bool):
# $Tween.interpolate_property(self, "modulate", modulate, Color(1.0, 1.0, 1.0, float(visible)), 1.0)
$Tween.interpolate_property(self, "position", position, Vector2(0.0, float(!visible)*1080), 1.0)
$Tween.start()