Skip to content

ToastControl and Toaster

InvexGames edited this page Feb 15, 2015 · 2 revisions

Description and Uses

ToastControl is a static script, designed to assist with easily creating toast messages. Toaster is a script that utilizes ToastControl to create toasts - presenting a more visual/UnityEvent based system.

A toast popup in action


Options

Toaster

To use the Toaster component, you simply need to call the PopupToast() function, which will automatically create a toast based on the options in the component.

ToastControl

The ToastControl functions can be called from anywhere, allowing for easier interaction if you're already using code.

InitToastSystem(Canvas theCanvas) - This must be called before any toasts are created. It prepares the Toast prefab and sets the correct Canvas. (Toaster does this automatically)

MakeToast (string content, float duration, Color panelColor, Color textColor, int fontSize) - This instantiates a toast message with the given parameters.

Clone this wiki locally