Class Shapes

java.lang.Object
net.ixdarklord.folios.internal.client.page.Shapes

public final class Shapes extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The little controls printed on pages: each a pixel icon on a clasp ('X' in its ink, 'o' a softer shade).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    How big a clasp is, square.
    static final int
    How many leaves of a book's block show past its pages, a pixel each.
    static final int
    The spine's width between a screen book's pages, which a spread's halves draw on into to meet.
    static final int
    How wide a scrollbar is.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    acrossFold(FoliosPainter painter, net.minecraft.util.FormattedCharSequence line, int y, int color, boolean right)
    A line of text centred on a spread's fold, as each page of it prints it: only the letters whose middle is on its side, placed so the halves meet as one line while the book lies open (on a screen book, across the spine between the pages).
    static void
    arrow(FoliosPainter painter, int x, int y, int color)
    A small arrow pointing right (the arrow sprite), 9 by 7 pixels from (x, y).
    static void
    button(FoliosPainter painter, int x, int y, Shapes.Icon icon, boolean hovered)
    A control: an eight-sided clasp of the page's own paper with a hairline rim and its icon in the middle.
    static void
    deckle(FoliosPainter painter, int x0, int x1, int y, boolean down, int behind)
    A page's rough-cut edge along its head (down false: the edge is row y, the page below it) or its foot (down true: the page above): small irregular bites out of the paper, showing behind, and a faint worn line where the edge is whole.
    static void
    deckle(FoliosPainter painter, int x0, int x1, int y, boolean down, int behind, float wear)
    As deckle(FoliosPainter, int, int, int, boolean, int), cut rougher for a wear over 1.
    static void
    foreEdge(FoliosPainter painter, int x, int y0, int y1, boolean right)
    The fore-edge of a book's leaves: the block of pages showing past the page, a pixel a leaf, from x (the page's edge) outwards, rightwards or leftwards; from y0 to y1.
    static void
    foreEdge(FoliosPainter painter, int x, int y0, int y1, boolean right, int leaves)
    The same, leaves wide.
    static void
    numberButton(FoliosPainter painter, int x, int y, int width, String number, boolean hovered, boolean picked)
    A clasp width wide with a number on it in place of an icon, for picking one of several things a page shows.
    static void
    pageFrame(FoliosPainter painter, net.minecraft.resources.Identifier texture, int width, int height)
    The page's frame, drawn under what is on it: the book's frame texture over the whole page, tinted between the page's lines and the book's colour, so it sits as quietly on dark paper as on parchment.
    static void
    pageFrame(FoliosPainter painter, net.minecraft.resources.Identifier texture, int width, int height, @Nullable FoliosPageElement.Laid page, boolean right)
    The page's frame, or for half of a spread the frame joined with the other half's: its side at the fold left out, its top and bottom running on (a plain middle column of the texture, stretched) to meet the other page's.
    static void
    panel(FoliosPainter painter, int x0, int y0, int x1, int y1)
    A panel (the panel sprite): its corner pixels left out, so it reads as slightly rounded.
    static int
    ribbonRoot(int edge, int depth)
    Where a ribbon tucked depth leaves deep comes out of the fore-edge at the page's edge.
    static void
    scrollbar(FoliosPainter painter, int x, int y, int height, int thumbY, int thumb, boolean over)
    A scrollbar (the scrollbar sprites) height pixels down from (x, y): its groove in the book's panel and line colours, and its thumb, thumb pixels tall at thumbY, in the colour of its clasps' lit rim (brighter while it is held or under the pointer), with a grip on it when it is tall enough to hold one.
    static void
    slot(FoliosPainter painter, int x, int y)
    An 18-pixel slot (the slot sprite) for an item drawn at (x + 1, y + 1).
    static void
    slot(FoliosPainter painter, int x, int y, int size)
    A slot size pixels square, its edge a pixel wide at any size.
    static int
    tabDepth(int order, float out)
    How deep among the leaves a tab is tucked, in leaves: the top one just under the surface, each below a little deeper; the open one (and, part way, one under the pointer) rises to the surface.
    static int
    tabDepth(int order, float out, int leaves)
    The same, in a fore-edge leaves wide.
    static void
    tuck(FoliosPainter painter, int edge, int y, int height, int depth, int ribbon)
    Over a ribbon's root, the leaves above it: they lie on it from the page's edge to where it comes out of the block, so it is seen between the leaves at its depth; and a soft shadow they cast on it as it leaves them.
    static void
    wornEdges(FoliosPainter painter, int x0, int y0, int x1, int y1, boolean outerRight, int behind)
    A page worn with age, from x0 to x1 and y0 to y1: yellowing creeping in from its head, its foot and its outer side (not its fold) unevenly, deeper here and shallower there; a few faint stains; and the odd small nick or tear in its outer edge.
    static void
    wornEdges(FoliosPainter painter, int x0, int y0, int x1, int y1, boolean outerRight, int behind, float wear)
    As wornEdges(FoliosPainter, int, int, int, int, boolean, int), as worn as wear says: 1 lightly, more for a well-thumbed book, its yellowing deeper and stronger, its nicks more and bigger, more stains, and its outer corners rubbed dark.

    Methods inherited from class Object

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

    • SCROLLBAR

      public static final int SCROLLBAR
      How wide a scrollbar is.
      See Also:
    • SCREEN_SPINE

      public static final int SCREEN_SPINE
      The spine's width between a screen book's pages, which a spread's halves draw on into to meet.
      See Also:
    • FORE_EDGE

      public static final int FORE_EDGE
      How many leaves of a book's block show past its pages, a pixel each.
      See Also:
    • BUTTON

      public static final int BUTTON
      How big a clasp is, square.
      See Also:
  • Method Details

    • panel

      public static void panel(FoliosPainter painter, int x0, int y0, int x1, int y1)
      A panel (the panel sprite): its corner pixels left out, so it reads as slightly rounded.
    • scrollbar

      public static void scrollbar(FoliosPainter painter, int x, int y, int height, int thumbY, int thumb, boolean over)
      A scrollbar (the scrollbar sprites) height pixels down from (x, y): its groove in the book's panel and line colours, and its thumb, thumb pixels tall at thumbY, in the colour of its clasps' lit rim (brighter while it is held or under the pointer), with a grip on it when it is tall enough to hold one.
    • slot

      public static void slot(FoliosPainter painter, int x, int y)
      An 18-pixel slot (the slot sprite) for an item drawn at (x + 1, y + 1).
    • slot

      public static void slot(FoliosPainter painter, int x, int y, int size)
      A slot size pixels square, its edge a pixel wide at any size.
    • pageFrame

      public static void pageFrame(FoliosPainter painter, net.minecraft.resources.Identifier texture, int width, int height)
      The page's frame, drawn under what is on it: the book's frame texture over the whole page, tinted between the page's lines and the book's colour, so it sits as quietly on dark paper as on parchment. On a page larger than the default its corners and the ornaments at the middle of its head and foot keep their size; only the plain runs of line between them are drawn longer.
    • pageFrame

      public static void pageFrame(FoliosPainter painter, net.minecraft.resources.Identifier texture, int width, int height, @Nullable FoliosPageElement.Laid page, boolean right)
      The page's frame, or for half of a spread the frame joined with the other half's: its side at the fold left out, its top and bottom running on (a plain middle column of the texture, stretched) to meet the other page's.
    • acrossFold

      public static void acrossFold(FoliosPainter painter, net.minecraft.util.FormattedCharSequence line, int y, int color, boolean right)
      A line of text centred on a spread's fold, as each page of it prints it: only the letters whose middle is on its side, placed so the halves meet as one line while the book lies open (on a screen book, across the spine between the pages). Nothing is drawn past the page, so a leaf turning carries its own letters and leaves none behind.
    • foreEdge

      public static void foreEdge(FoliosPainter painter, int x, int y0, int y1, boolean right)
      The fore-edge of a book's leaves: the block of pages showing past the page, a pixel a leaf, from x (the page's edge) outwards, rightwards or leftwards; from y0 to y1.
    • foreEdge

      public static void foreEdge(FoliosPainter painter, int x, int y0, int y1, boolean right, int leaves)
      The same, leaves wide.
    • deckle

      public static void deckle(FoliosPainter painter, int x0, int x1, int y, boolean down, int behind)
      A page's rough-cut edge along its head (down false: the edge is row y, the page below it) or its foot (down true: the page above): small irregular bites out of the paper, showing behind, and a faint worn line where the edge is whole.
    • deckle

      public static void deckle(FoliosPainter painter, int x0, int x1, int y, boolean down, int behind, float wear)
      As deckle(FoliosPainter, int, int, int, boolean, int), cut rougher for a wear over 1.
    • wornEdges

      public static void wornEdges(FoliosPainter painter, int x0, int y0, int x1, int y1, boolean outerRight, int behind)
      A page worn with age, from x0 to x1 and y0 to y1: yellowing creeping in from its head, its foot and its outer side (not its fold) unevenly, deeper here and shallower there; a few faint stains; and the odd small nick or tear in its outer edge. outerRight for a right-hand page, whose outer side is at x1. Drawn over the paper, under what is on the page; the same every frame.
    • wornEdges

      public static void wornEdges(FoliosPainter painter, int x0, int y0, int x1, int y1, boolean outerRight, int behind, float wear)
      As wornEdges(FoliosPainter, int, int, int, int, boolean, int), as worn as wear says: 1 lightly, more for a well-thumbed book, its yellowing deeper and stronger, its nicks more and bigger, more stains, and its outer corners rubbed dark.
    • tabDepth

      public static int tabDepth(int order, float out)
      How deep among the leaves a tab is tucked, in leaves: the top one just under the surface, each below a little deeper; the open one (and, part way, one under the pointer) rises to the surface. order is its place from the top, out how far it is out (TabMotion.out).
    • tabDepth

      public static int tabDepth(int order, float out, int leaves)
      The same, in a fore-edge leaves wide.
    • ribbonRoot

      public static int ribbonRoot(int edge, int depth)
      Where a ribbon tucked depth leaves deep comes out of the fore-edge at the page's edge.
    • tuck

      public static void tuck(FoliosPainter painter, int edge, int y, int height, int depth, int ribbon)
      Over a ribbon's root, the leaves above it: they lie on it from the page's edge to where it comes out of the block, so it is seen between the leaves at its depth; and a soft shadow they cast on it as it leaves them. ribbon is the tab's colour, for its shadow.
    • button

      public static void button(FoliosPainter painter, int x, int y, Shapes.Icon icon, boolean hovered)
      A control: an eight-sided clasp of the page's own paper with a hairline rim and its icon in the middle. Under the pointer it lifts off the page, casting a little shadow, and its icon takes the book's colour.
    • numberButton

      public static void numberButton(FoliosPainter painter, int x, int y, int width, String number, boolean hovered, boolean picked)
      A clasp width wide with a number on it in place of an icon, for picking one of several things a page shows. The one picked is pressed into the page, its face of the book's colour; another lifts under the pointer.
    • arrow

      public static void arrow(FoliosPainter painter, int x, int y, int color)
      A small arrow pointing right (the arrow sprite), 9 by 7 pixels from (x, y).