This is a super simple toast plugin for Godot engine. It works for 3.2 only with the new buildsystem (although you could probably make it work for the older version easily enough)
The module has been tested with Godot-3.2-stable on two physical android devices (Samsung note 3, Huawei p20) and bluestacks
For now the module simply has one function to display a toast.
-
Set up the build system as detailed in the docs
-
Copy the "GodotToast" folder to the android folder inside of your project;
-
Add the module in the project settings
org/godotengine/godot/GodotToast
seperating multiple with,
-
On the project Export settings, check "use custom export"
To use the module functions on your scripts, start the module as follows:
var toast
func _ready():
if(Engine.has_singleton("GodotToast")):
toast= Engine.get_singleton("GodotToast")
(You can learn more about Singletons and initializations here).
Then use the function wherever you want.
toast.sendToast("Your Message")
I would advise you check that toast != null
first in case you are running on other platforms also.
if toast:
toast.sendToast("Your Toast is ready")
else:
print("GodotToast Module not found")