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 pBookAccess)
    • setPage

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

      protected boolean forcePage(int pPageNum)
      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 pKeyCode, int pScanCode, int pModifiers)
      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:
      pKeyCode - the key code of the pressed key.
      pScanCode - the scan code of the pressed key.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • 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.
    • renderBackground

      public void renderBackground(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Overrides:
      renderBackground 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.
    • handleComponentClicked

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

      protected void closeScreen()
    • getClickedComponentStyleAt

      @Nullable public Style getClickedComponentStyleAt(double pMouseX, double pMouseY)