Class BookViewScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement
Direct Known Subclasses:
LecternScreen

public class BookViewScreen extends Screen
  • Field Details

  • Constructor Details

  • Method Details

    • setBookAccess

      public void setBookAccess(BookViewScreen.BookAccess bookAccess)
    • setPage

      public boolean setPage(int pageNum)
      Moves the book to the specified page and returns true if it exists, false otherwise.
    • forcePage

      protected boolean forcePage(int pageNum)
      I'm not sure why this exists. The function it calls is public and does all the work.
    • init

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

      protected void createMenuControls()
    • createPageControlButtons

      protected void createPageControlButtons()
    • getNumPages

      private int getNumPages()
    • pageBack

      protected void pageBack()
    • pageForward

      protected void pageForward()
    • updateButtonVisibility

      private void updateButtonVisibility()
    • keyPressed

      public boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Called when a keyboard key is pressed within the GUI element.

      Specified by:
      keyPressed in interface ContainerEventHandler
      Specified by:
      keyPressed in interface GuiEventListener
      Overrides:
      keyPressed in class Screen
      Parameters:
      keyCode - the key code of the pressed key.
      scanCode - the scan code of the pressed key.
      modifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • 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.
    • renderBackground

      public void renderBackground(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
      Overrides:
      renderBackground 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.
    • handleComponentClicked

      public boolean handleComponentClicked(Style style)
      Overrides:
      handleComponentClicked in class Screen
    • closeScreen

      protected void closeScreen()
    • getClickedComponentStyleAt

      @Nullable public Style getClickedComponentStyleAt(double mouseX, double mouseY)