Class Menus
A set of static methods to deal with MLEM.Ui and in-game menus
Inheritance
Inherited Members
Namespace: TinyLife.Uis
Assembly: Tiny Life.dll
Syntax
public static class Menus
Methods
GamepadHint(Anchor, Func<Options, Buttons>, Vector2, Nullable<Vector2>, Func<Boolean>)
Returns a new image that displays information about what gamepad shouldHide
returns true.
Declaration
public static Image GamepadHint(Anchor anchor, Func<Options, Buttons> button, Vector2 positionOffset = null, Vector2? size = null, Func<bool> shouldHide = null)
Parameters
Type | Name | Description |
---|---|---|
MLEM.Ui.Anchor | anchor | The anchor for the image. |
System.Func<Options, Buttons> | button | A function that returns the button that should be displayed. |
Vector2 | positionOffset | The position offset for the image. |
System.Nullable<Vector2> | size | The size of the image, or null for the image to be 12 pixels big. |
System.Func<System.Boolean> | shouldHide | A function that determines whether the hint should currently be hidden, or null to only hide it when gamepad controls are not currently being used. |
Returns
Type | Description |
---|---|
MLEM.Ui.Elements.Image | The created gamepad hint image. |
Transition(Action, Action, Menus.TransitionType, Menus.TransitionType, Single, Single, Single, Nullable<Color>)
Displays a screen transition that includes a fade out, an inbetween
action, followed by a fade back in and an after
action.
Declaration
public static void Transition(Action inbetween = null, Action after = null, Menus.TransitionType outType = Menus.TransitionType.Swipe, Menus.TransitionType inType = Menus.TransitionType.Swipe, float outSpeed = 0.05F, float inSpeed = 0.05F, float waitInbetween = 0.15F, Color? color = null)
Parameters
Type | Name | Description |
---|---|---|
System.Action | inbetween | The action that is invoked while the screen is faded out, or null to invoke no action. |
System.Action | after | The action that is invoked after the full fade routine completes, or null to invoke no action. |
Menus.TransitionType | outType | The Menus.TransitionType used for fading out. |
Menus.TransitionType | inType | The Menus.TransitionType used for fading in. |
System.Single | outSpeed | The speed with which |
System.Single | inSpeed | The speed with which |
System.Single | waitInbetween | The amount of time to wait while the screen is faded out. |
System.Nullable<Color> | color | The color that the fade should have, or null to use black. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when a fade is already happening when this method is called. |