-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDemo.gd
28 lines (25 loc) · 1010 Bytes
/
Demo.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
extends Node
var toast;
func _ready():
call_deferred("showToast", "normal")
func showToast(type: String):
match type:
"normal":
toast = Toast.new("This is the default toast", Toast.LENGTH_SHORT)
get_node("/root").add_child(toast)
toast.connect("done", self, "showToast", ["full"])
toast.show()
"full":
toast = Toast.new("This is a full toast", Toast.LENGTH_SHORT, preload("res://full_bottom_toast_style.tres"))
get_node("/root").add_child(toast)
toast.connect("done", self, "showToast", ["normal_top"])
toast.show()
"normal_top":
toast = Toast.new("This is a normal toast positioned at the top", Toast.LENGTH_SHORT, preload("res://float_top_toast_style.tres"))
get_node("/root").add_child(toast)
toast.connect("done", self, "showToast", ["full_top"])
toast.show()
"full_top":
toast = Toast.new("This is a full toast positioned at the top", Toast.LENGTH_SHORT, preload("res://full_top_toast_style.tres"))
get_node("/root").add_child(toast)
toast.show()