ToasterController

ToasterController is a popup easily configurable by code, appearing from a side of the screen. It consists in:

  • A title,
  • A message,
  • A close button,
  • A container to display your custom content
_images/toastercontroller_1.png

Displaying a ToasterController

Namespace

using AsmodeeNet.UserInterface;

Instantiation

With title and message:

Toaster toaster = ToasterController.InstantiateToaster("title", "message", showCloseButton:true, adaptSizeToContent:true, ToasterController.Anchor.TopLeft);

adaptSizeToContent set to true will display the complete message without truncating it.

With custom content:

GameObject gameObject = Instantiate(customContentPrefab);
RectTransform customContent = gameObject.transform as RectTransform;
Toaster toaster = ToasterController.InstantiateToaster(customContent, showCloseButton:true, ToasterController.Anchor.TopLeft);

Skinning

You can skin the Toaster panel by following the process described in Skinning the User Interface.