-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_scene.gd
More file actions
40 lines (27 loc) · 950 Bytes
/
test_scene.gd
File metadata and controls
40 lines (27 loc) · 950 Bytes
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
extends Control
@onready var info: Label = $VBoxContainer/Info
var plugin
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
if Engine.has_singleton("GodotAndroidPluginTemplate"):
plugin = Engine.get_singleton("GodotAndroidPluginTemplate")
info.text += "Found GodotAndroidPluginTemplate"
plugin.userSayHello.connect(_on_user_say_hello)
plugin.userPrintHello.connect(_on_user_print_hello)
else:
info.text += "Failed to find GodotAndroidPluginTemplate"
printerr("Failed to find plugin")
func _on_hello_button_pressed() -> void:
plugin.sayHello()
func _on_say_hello_button_pressed() -> void:
var a = plugin.printHello()
print(a)
func _on_user_say_hello(success: bool) -> void:
info.text += "\n"
if success:
info.text += "\nSuccess SayHello"
else:
info.text += "\nFailed SayHello"
func _on_user_print_hello(some_text: String) -> void:
info.text += "\n"
info.text += some_text