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 pFading)
    • TitleScreen

      public TitleScreen(boolean pFading, @Nullable LogoRenderer pLogoRenderer)
  • Method Details

    • realmsNotificationsEnabled

      private boolean realmsNotificationsEnabled()
    • tick

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

      public static CompletableFuture<Void> preloadResources(TextureManager pTexMngr, Executor pBackgroundExecutor)
    • 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 pY, int pRowHeight)
      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 pY, int pRowHeight)
      Adds Demo buttons on Main Menu for players who are playing Demo.
    • checkDemoWorldPresence

      private boolean checkDemoWorldPresence()
    • render

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

      private void fadeWidgets(float pAlpha)
    • renderBackground

      public void renderBackground(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Overrides:
      renderBackground in class Screen
    • renderPanorama

      protected void renderPanorama(GuiGraphics pGuiGraphics, float pPartialTick)
      Overrides:
      renderPanorama in class Screen
    • mouseClicked

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

      Parameters:
      pMouseX - the X coordinate of the mouse.
      pMouseY - the Y coordinate of the mouse.
      pButton - 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 p_96778_)