Class PopupLayer

java.lang.Object
net.ixdarklord.folios.internal.client.screen.PopupLayer

public final class PopupLayer extends Object
A book's popup windows (FoliosPopup), over everything else on the screen: the one a link under the pointer shows, in place of a tooltip, and the one pressing it pinned, which stays where it was until the reader presses off it, presses Esc or turns the page. A pinned one takes the pointer: its scene turns when dragged and zooms with the wheel. Screens hand it the pointer in their own (GUI) pixels; its painter works in the popup's own.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    click(FoliosReader reader, double mouseX, double mouseY)
    A press: on a pinned popup, what is under it; off it, puts it away.
    boolean
    drag(double dx, double dy)
    The pointer dragged (GUI pixels): true when it turns a pinned popup's scene.
    boolean
    draw(net.minecraft.client.gui.GuiGraphicsExtractor graphics, FoliosReader reader, FoliosPalette palette, @Nullable FoliosPopup hovered, int mouseX, int mouseY, float scale, int screenWidth, int screenHeight)
    Draws the pinned popup, else the one under the pointer; true when one under the pointer was drawn (the screen's tooltip is then left out).
    boolean
    Esc: true when it put a pinned popup away.
    void
     
    boolean
    scroll(FoliosReader reader, double mouseX, double mouseY, double notches)
    The wheel: true when the pointer is over a pinned popup (zooming its scene, if over one).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PopupLayer

      public PopupLayer()
  • Method Details

    • draw

      public boolean draw(net.minecraft.client.gui.GuiGraphicsExtractor graphics, FoliosReader reader, FoliosPalette palette, @Nullable FoliosPopup hovered, int mouseX, int mouseY, float scale, int screenWidth, int screenHeight)
      Draws the pinned popup, else the one under the pointer; true when one under the pointer was drawn (the screen's tooltip is then left out).
    • click

      public boolean click(FoliosReader reader, double mouseX, double mouseY)
      A press: on a pinned popup, what is under it; off it, puts it away. True when the press was the popup's.
    • drag

      public boolean drag(double dx, double dy)
      The pointer dragged (GUI pixels): true when it turns a pinned popup's scene.
    • release

      public void release()
    • scroll

      public boolean scroll(FoliosReader reader, double mouseX, double mouseY, double notches)
      The wheel: true when the pointer is over a pinned popup (zooming its scene, if over one).
    • escape

      public boolean escape(FoliosReader reader)
      Esc: true when it put a pinned popup away.