Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
A plugin that allows you to make Android like toast on all platforms
Godot Toasts
A plugin that allows you to make Android like toast on all platforms
Enable the plugin
Add the addons folder in you project like your would with any other plugin. Go to project settings -> plugins
and activate the plugin.
Using the plugin
Wherever you want to use just paste this:
var toast = Toast.new("Toast text", Toast.LENGHT_SHORT)
get_node("/root").add_child(toast)
toast.show()
It is best to make the TOAST a child of the root node so that there are no overlapping problems.
The toast will delete itself after it finished.
There is no purpose to add the Toast from the editor.
Toast
Inherits: Control < CanvasItem < Node < Object
Methods
Toast | new(text: String, lenght: ToastLenght, mstyle: ToastStyle = preload( "style_resource/default.tres") ) |
---|---|
void | show() |
Properties
Resource | style |
---|
Enumerations
enum ToastLenght
:
LENGHT_SHORT: the toast will last for 1.5 seconds, including the fading
LENGHT_LONG: the toast will last for 3 seconds, including the fading
Signals
done()
Emitted when the toast has terminated its job and is preparing for deleteing itself.
Property Descriptions
Resource
style
Controls the toast aspect. The value is declared as a Resource, even if there is a custom resource because of a Godot limitation. Will be changed in Godot 4.0.(see this)
Methods Descriptions
Toast new(text: String, lenght: ToastLenght)
Returns a new Toast. Thetext
is the text that will be shown inside of the toast.lenght
represents the duration lenght.mstyle
represents the toast syle stored in style(see propriety descriptions).void show()
Starts the toast.
ToastStyle
Inherits: Reference < Object
A resource that controls the toast aspect. You can create one in the inspector panel and save it as tres or res. Recomandation: If you select Full Type make corner radius 0;
A plugin that allows you to make Android like toast on all platforms
Reviews
Quick Information
A plugin that allows you to make Android like toast on all platforms