-
Notifications
You must be signed in to change notification settings - Fork 0
/
xxx-presents.gd
70 lines (54 loc) · 1.6 KB
/
xxx-presents.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
59
60
61
62
63
64
65
66
67
68
69
70
extends CenterContainer
var menu_fade_out = false
var menu_fade_in = false
var text_fade_out = false
var timer0 := Timer.new()
var timer1 := Timer.new()
var timer2 := Timer.new()
var timer3 := Timer.new()
func _ready():
timer0.one_shot = true
timer1.one_shot = true
timer2.one_shot = true
timer3.one_shot = true
timer0.timeout.connect(_timer0)
timer1.timeout.connect(_timer1)
timer2.timeout.connect(_timer2)
timer3.timeout.connect(_timer3)
add_child(timer0)
add_child(timer1)
add_child(timer2)
add_child(timer3)
get_node("../black2").set_modulate(Color(1,1,1,1))
timer0.start(1)
func _timer0():
timer1.start(3)
menu_fade_in = true
func _timer1():
timer2.start(1)
get_node("../AudioStreamPlayer").playing = true
get_node("../black2").visible = false
func _timer2():
text_fade_out = true
timer3.start(2)
func _timer3():
menu_fade_out = true
func _physics_process(delta):
if menu_fade_in == true && menu_fade_out == false:
set_modulate(lerp(get_modulate(), Color(1,1,1,1), 0.02))
if get_modulate().a > 0.9:
set_modulate(Color(1,1,1,1))
menu_fade_in = false
if menu_fade_out == true && menu_fade_in == false:
set_modulate(lerp(get_modulate(), Color(1,1,1,0), 0.02))
if get_modulate().a < 0.8:
mouse_filter = Control.MOUSE_FILTER_IGNORE
if get_modulate().a < 0.1:
set_modulate(Color(1,1,1,0))
menu_fade_out = false
visible = false
if text_fade_out == true:
$VBoxContainer2.set_modulate(lerp($VBoxContainer2.get_modulate(), Color(1,1,1,0), 0.02))
if $VBoxContainer2.get_modulate().a < 0.1:
$VBoxContainer2.set_modulate(Color(1,1,1,0))
text_fade_out = false