Notifications - Ellpeck/TinyLifeExampleMod Wiki

Tiny Life

TinyLife.Uis

Notifications Class

This class holds information about the current and past notifications that are displayed in the top center of the screen.
To create custom notifications, use Add(MapObject, string, NotifType) or Add(TextureRegion, string, NotifType).

public static class Notifications

Inheritance System.Object 🡒 Notifications

Methods

Notifications.Add(TextureRegion, string, NotifType) Method

Adds a new notification related to nothing.
The passed icon is displayed instead of an object.

public static void Add(MLEM.Textures.TextureRegion icon, string content, TinyLife.Uis.NotifType type=TinyLife.Uis.NotifType.Info);

Parameters

icon MLEM.Textures.TextureRegion
The icon that should be displayed in the notification

content System.String
The content of the notification. Should be localized using Localization

type NotifType
The type that this notification should have, which determines the color of its background

Notifications.Add(MapObject, string, NotifType) Method

Adds a new notification related to the given map object.
The passed object is also the one that will be displayed in the notification.

public static void Add(TinyLife.Objects.MapObject obj, string content, TinyLife.Uis.NotifType type=TinyLife.Uis.NotifType.Info);

Parameters

obj MapObject
The map object that this notification relates to

content System.String
The content of the notification. Should be localized using Localization

type NotifType
The type that this notification should have, which determines the color of its background