Class FoliosBar

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

public final class FoliosBar extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Gives the search field the keyboard: the screen's focus and the field's own.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final PixelIcon
    Lines of a list, for the index tab.
    static final int
    Where its content starts, below its top gilt line.
    static final PixelIcon
    A four-pointed sparkle, marking what hasn't been read yet, as the frames of its blink: from a point of light through a small star to its resting shape and a flare with its points drawn out.
    static final PixelIcon
     
    static final PixelIcon
    The star, its edge only: a page not yet bookmarked.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FoliosBar(FoliosReader reader, boolean modeToggle, @Nullable Runnable close, FoliosBar.Focus focus)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    draw(FoliosPainter painter, int width, float appear)
    Draws it in its own pixels, the given width across.
    The colours its painter is given: the cover's, so what is drawn see-through lies over the leather.
    static void
    pixels(FoliosPainter painter, PixelIcon icon, int boxX, int boxY, int boxSize, int color)
    The same, through a painter (a page, a handheld book's tab, the bar).
    net.ixdarklord.coolcatcanvas.internal.client.gui.style.StyledEditBox
    search(@Nullable net.ixdarklord.coolcatcanvas.internal.client.gui.style.StyledEditBox before)
    Makes the search field, carrying over what an earlier one held; the screen adds it as a widget.
    @Nullable net.ixdarklord.coolcatcanvas.internal.client.gui.style.StyledEditBox
     
    float
    How open it is, 0 folded to 1 open, eased.
    static void
    sparkle(FoliosPainter painter, int x, int y, float phase, int color)
    Draws the unread sparkle, 7 pixels square from (x, y), blinking now and then; phase (seconds) staggers sparkles so they don't all blink together.
    boolean
     

    Methods inherited from class Object

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

    • HEIGHT

      public static final int HEIGHT
      See Also:
    • INSET

      public static final int INSET
      Where its content starts, below its top gilt line.
      See Also:
    • STAR

      public static final PixelIcon STAR
    • STAR_OUTLINE

      public static final PixelIcon STAR_OUTLINE
      The star, its edge only: a page not yet bookmarked.
    • SPARKLE

      public static final PixelIcon SPARKLE
      A four-pointed sparkle, marking what hasn't been read yet, as the frames of its blink: from a point of light through a small star to its resting shape and a flare with its points drawn out.
    • INDEX

      public static final PixelIcon INDEX
      Lines of a list, for the index tab.
  • Constructor Details

    • FoliosBar

      public FoliosBar(FoliosReader reader, boolean modeToggle, @Nullable Runnable close, FoliosBar.Focus focus)
      Parameters:
      modeToggle - whether it has the light/dark paper button (a book whose paper follows the mode)
      close - what its close button does, or null for none
      focus - how the screen gives the search field the keyboard
  • Method Details

    • search

      public net.ixdarklord.coolcatcanvas.internal.client.gui.style.StyledEditBox search(@Nullable net.ixdarklord.coolcatcanvas.internal.client.gui.style.StyledEditBox before)
      Makes the search field, carrying over what an earlier one held; the screen adds it as a widget. It is kept off the screen: it only takes the keys, and the bar shows what is in it.
    • searchField

      public @Nullable net.ixdarklord.coolcatcanvas.internal.client.gui.style.StyledEditBox searchField()
    • typing

      public boolean typing()
    • shown

      public float shown()
      How open it is, 0 folded to 1 open, eased.
    • palette

      public FoliosPalette palette()
      The colours its painter is given: the cover's, so what is drawn see-through lies over the leather.
    • draw

      public void draw(FoliosPainter painter, int width, float appear)
      Draws it in its own pixels, the given width across. appear, 0 to 1, grows it out of its pull as it comes (a handheld book's, once the book is open); 1 when it is simply there.
    • sparkle

      public static void sparkle(FoliosPainter painter, int x, int y, float phase, int color)
      Draws the unread sparkle, 7 pixels square from (x, y), blinking now and then; phase (seconds) staggers sparkles so they don't all blink together. Brighter on its flare. The blink is smooth: the sparkle eases from rest out to its flare, down to a point and back, each pixel fading between the frames on either side.
    • pixels

      public static void pixels(FoliosPainter painter, PixelIcon icon, int boxX, int boxY, int boxSize, int color)
      The same, through a painter (a page, a handheld book's tab, the bar).