/// <summary> /// Creates a new MessageBoxPhase. Use this to gain simple choices from the player. /// </summary> /// <param name="text">Text to display to the player.</param> /// <param name="caption">MessageBox caption.</param> /// <param name="icon">Icon displayed in the message box.</param> /// <param name="buttons">Buttons displayed in the message box.</param> public MessageBoxPhase(string text, string caption, GuiIcon icon, MessageBoxButtons buttons) { Text = text; Caption = caption; Icon = icon; ButtonsType = buttons; }
/// <summary> /// Creates a new MessageBoxPhase. Use this to gain simple choices from the player. /// </summary> /// <param name="text">Text to display to the player.</param> /// <param name="caption">MessageBox caption.</param> /// <param name="icon">Icon displayed in the message box.</param> /// <param name="buttons">Buttons displayed in the message box.</param> public MessageBoxPhase(string text, string caption, GuiIcon icon, MessageBoxButtons buttons, Action <string> whatWithNewName) { Text = text; Caption = caption; Icon = icon; ButtonsType = buttons; WhatWithNewName = whatWithNewName; }
public Toast(string text, Color color, float duration, int y, GuiIcon icon) { Text = text; ForeColor = color; Duration = duration; Y = y; Icon = icon; Ascending = true; TargetY = Root.ScreenHeight - TOAST_HEIGHT; }
/// <summary> /// For the given icon description, returns an appropriate texture. /// </summary> /// <param name="icon"></param> public static Texture2D GetTexture2DFromGuiIcon(GuiIcon icon) { switch (icon) { case GuiIcon.Error: return(Library.IconError); case GuiIcon.Information: return(Library.IconInformation); case GuiIcon.Question: return(Library.IconQuestion); case GuiIcon.Warning: return(Library.IconWarning); } return(null); }
/// <summary> /// Creates a new message box and pushes it on the top of the stack. /// </summary> /// <param name="text">Text of the message box.</param> /// <param name="caption">Caption of the message box.</param> /// <param name="icon">Icon displayed in the message box.</param> /// <param name="buttons">Buttons displayed in the message box.</param> public static void MessageBox(string text, string caption = "Message", GuiIcon icon = GuiIcon.Information, MessageBoxButtons buttons = MessageBoxButtons.OK) { MessageBoxPhase phaseMsgBox = new MessageBoxPhase(text, caption, icon, buttons, null); Root.PushPhase(phaseMsgBox); }
/// <summary> /// Creates a new short message to be displayed at the bottom of the screen. /// </summary> /// <param name="text">Message text.</param> /// <param name="color">Text color.</param> /// <param name="duration">Message duration in seconds.</param> /// <param name="icon">Prepended icon to the message.</param> public static void SendToast(string text, Color?color = null, float duration = Toast.TOAST_DEFAULT_DURATION, GuiIcon icon = GuiIcon.None) { int y = Root.ScreenHeight; Color clr = color ?? Color.Black; Toasts.Add(new Toast(text, clr, duration, y, icon)); }