Class Screen

java.lang.Object
dev.xichil.mvui.Screen
Direct Known Subclasses:
ConfirmDialog, MenuScreen

public abstract class Screen extends Object
Something a UiHost can open: exactly one of MenuScreen (a list of widgets) or ConfirmDialog (a yes/no question). The set is closed: the constructor is package-private, so mods can't define their own screen types; they compose screens from the existing widgets instead.

A screen is an immutable description, built with its type's builder. Each has an id (for tests and logs) and a title (shown at the top of the screen).

  • Method Details

    • id

      public String id()
      The screen's id, as given to its builder; matches [A-Za-z0-9_.-]+. Not shown to players. Need not be unique across screens, but a distinct id per screen makes tests and logs easier to read.
      Returns:
      the id given to the builder
    • title

      public Text title()
      The title shown at the top of the screen; never null.
      Returns:
      the title given to the builder