Class TitleScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement

public class TitleScreen extends Screen
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • TITLE

      private static final Component TITLE
    • DEMO_LEVEL_ID

      private static final String DEMO_LEVEL_ID
      See Also:
    • FADE_IN_TIME

      private static final float FADE_IN_TIME
      See Also:
    • splash

      @Nullable private SplashRenderer splash
    • resetDemoButton

      private Button resetDemoButton
    • realmsNotificationsScreen

      @Nullable private RealmsNotificationsScreen realmsNotificationsScreen
      A screen generated by realms for notifications drawn in addition to the main menu (buttons and such from both are drawn at the same time). May be null.
    • panoramaFade

      private float panoramaFade
    • fading

      private boolean fading
    • fadeInStart

      private long fadeInStart
    • logoRenderer

      private final LogoRenderer logoRenderer
  • Constructor Details

    • TitleScreen

      public TitleScreen()
    • TitleScreen

      public TitleScreen(boolean fading)
    • TitleScreen

      public TitleScreen(boolean fading, @Nullable LogoRenderer logoRenderer)
  • Method Details

    • realmsNotificationsEnabled

      private boolean realmsNotificationsEnabled()
    • tick

      public void tick()
      Overrides:
      tick in class Screen
    • preloadResources

      public static CompletableFuture<Void> preloadResources(TextureManager texMngr, Executor backgroundExecutor)
    • isPauseScreen

      public boolean isPauseScreen()
      Overrides:
      isPauseScreen in class Screen
    • shouldCloseOnEsc

      public boolean shouldCloseOnEsc()
      Overrides:
      shouldCloseOnEsc in class Screen
    • init

      protected void init()
      Overrides:
      init in class Screen
    • createNormalMenuOptions

      private void createNormalMenuOptions(int y, int rowHeight)
      Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game.
    • getMultiplayerDisabledReason

      @Nullable private Component getMultiplayerDisabledReason()
    • createDemoMenuOptions

      private void createDemoMenuOptions(int y, int rowHeight)
      Adds Demo buttons on Main Menu for players who are playing Demo.
    • checkDemoWorldPresence

      private boolean checkDemoWorldPresence()
    • render

      public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class Screen
      Parameters:
      guiGraphics - the GuiGraphics object used for rendering.
      mouseX - the x-coordinate of the mouse cursor.
      mouseY - the y-coordinate of the mouse cursor.
      partialTick - the partial tick time.
    • fadeWidgets

      private void fadeWidgets(float alpha)
    • renderBackground

      public void renderBackground(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
      Overrides:
      renderBackground in class Screen
    • renderPanorama

      protected void renderPanorama(GuiGraphics guiGraphics, float partialTick)
      Overrides:
      renderPanorama in class Screen
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Called when a mouse button is clicked within the GUI element.

      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
      button - the button that was clicked.
      Returns:
      true if the event is consumed, false otherwise.
    • removed

      public void removed()
      Overrides:
      removed in class Screen
    • added

      public void added()
      Overrides:
      added in class Screen
    • confirmDemo

      private void confirmDemo(boolean confirmed)