Class RevealPainter

java.lang.Object
net.ixdarklord.folios.internal.client.paint.RevealPainter
All Implemented Interfaces:
FoliosPainter

public final class RevealPainter extends Object implements FoliosPainter
  • Nested Class Summary

    Nested classes/interfaces inherited from interface FoliosPainter

    FoliosPainter.Drag, FoliosPainter.Scroll
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    action(int x, int y, int width, int height, @Nullable net.minecraft.network.chat.Component tooltip, Runnable onPress)
    Makes a rectangle run something when pressed (on the client, during the press).
    void
    clip(int x, int y, int width, int height, Runnable draw)
    Draws with what is drawn kept inside a box, (x, y) width by height in the painter's pixels.
    boolean
    drag(int x, int y, int width, int height, FoliosPainter.Drag drag)
    Makes a rectangle draggable: held with the left button, it is told how far the pointer moves until let go.
    static void
    draw(FoliosPainter painter, FoliosPageElement.Laid page, @Nullable FoliosReveal effect, float progress, float pageX)
     
    void
    fill(int x0, int y0, int x1, int y1, int argb)
     
    boolean
    Whether the page is on a screen (true), or on a book in the world (false).
    net.minecraft.client.gui.Font
     
    boolean
    hovered(int x, int y, int width, int height)
    Whether the pointer is over a rectangle; never while the page is turning or covered.
    void
    item(net.minecraft.world.item.ItemStack stack, int x, int y)
    An item's icon, 16 pixels square; hovering shows its tooltip, and it links to the book's entry about it, if any.
    void
    item(net.minecraft.world.item.ItemStack stack, int x, int y, int argb)
    As FoliosPainter.item(ItemStack, int, int), tinted by argb: its alpha fades the item, its colour tints it (white leaves it as it is).
    boolean
    link(int x, int y, int width, int height, String target)
    Makes a rectangle open a link when pressed: entry:<id>, entry:<id>#<marker>, category:<id>, http(s)://..., or a bare entry id.
    of(FoliosPainter painter, @Nullable FoliosReveal effect, float progress, float pageX)
     
    int
     
    int
    The size of the page being drawn: the default page's unless the book's pages are larger (a screen book at a small GUI scale).
     
    void
    pop()
     
    void
     
    void
    scale(float factor)
     
    void
    scene(net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewport viewport, int x, int y, int width, int height)
    A scene's picture; the painter keeps it in use while it is drawn.
    void
    scene(net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewport viewport, int x, int y, int width, int height, float u0, float u1)
    As FoliosPainter.scene(SceneViewport, int, int, int, int), showing only the part of it from u0 to u1 across (0 to 1).
    void
    scene(net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewport viewport, int x, int y, int width, int height, float u0, float v0, float u1, float v1, int argb)
    As FoliosPainter.scene(SceneViewport, int, int, int, int), showing only the part of it from (u0, v0) to (u1, v1) (0 to 1, from its top left), tinted by argb: its alpha fades the picture.
    boolean
    scroll(int x, int y, int width, int height, FoliosPainter.Scroll scroll)
    Makes a rectangle take the mouse wheel while the pointer is over it, rather than the wheel turning the page.
    void
    silhouette(net.minecraft.world.item.ItemStack stack, int x, int y, int argb)
    An item's shape tinted by argb (dark, for a silhouette), with nothing of what it is: no count, no tooltip, no link.
    void
    text(net.minecraft.util.FormattedCharSequence text, int x, int y, int argb)
     
    void
    texture(net.minecraft.resources.Identifier texture, int x, int y, int width, int height, float u0, float v0, float u1, float v1, int argb)
    A part of a texture, from its (u0, v0) to its (u1, v1), each 0 to 1, tinted by argb.
    float
    Seconds since the book was opened: for what moves or cycles on a page.
    void
    tooltip(List<net.minecraft.network.chat.Component> lines)
    A tooltip of several lines: a name, then lines saying more.
    void
    tooltip(net.minecraft.network.chat.Component text)
    Shows a tooltip at the pointer this frame.
    void
    tooltip(net.minecraft.world.item.ItemStack stack)
     
    void
    translate(float x, float y)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface FoliosPainter

    centeredText, contentBottom, contentRight, text
  • Method Details

    • pageWidth

      public int pageWidth()
      Description copied from interface: FoliosPainter
      The size of the page being drawn: the default page's unless the book's pages are larger (a screen book at a small GUI scale).
      Specified by:
      pageWidth in interface FoliosPainter
    • pageHeight

      public int pageHeight()
      Specified by:
      pageHeight in interface FoliosPainter
    • draw

      public static void draw(FoliosPainter painter, FoliosPageElement.Laid page, @Nullable FoliosReveal effect, float progress, float pageX)
    • of

      public static FoliosPainter of(FoliosPainter painter, @Nullable FoliosReveal effect, float progress, float pageX)
    • fill

      public void fill(int x0, int y0, int x1, int y1, int argb)
      Specified by:
      fill in interface FoliosPainter
    • text

      public void text(net.minecraft.util.FormattedCharSequence text, int x, int y, int argb)
      Specified by:
      text in interface FoliosPainter
    • texture

      public void texture(net.minecraft.resources.Identifier texture, int x, int y, int width, int height, float u0, float v0, float u1, float v1, int argb)
      Description copied from interface: FoliosPainter
      A part of a texture, from its (u0, v0) to its (u1, v1), each 0 to 1, tinted by argb.
      Specified by:
      texture in interface FoliosPainter
    • item

      public void item(net.minecraft.world.item.ItemStack stack, int x, int y)
      Description copied from interface: FoliosPainter
      An item's icon, 16 pixels square; hovering shows its tooltip, and it links to the book's entry about it, if any.
      Specified by:
      item in interface FoliosPainter
    • item

      public void item(net.minecraft.world.item.ItemStack stack, int x, int y, int argb)
      Description copied from interface: FoliosPainter
      As FoliosPainter.item(ItemStack, int, int), tinted by argb: its alpha fades the item, its colour tints it (white leaves it as it is). A painter that can't fade items shows it once its alpha is past half.
      Specified by:
      item in interface FoliosPainter
    • silhouette

      public void silhouette(net.minecraft.world.item.ItemStack stack, int x, int y, int argb)
      Description copied from interface: FoliosPainter
      An item's shape tinted by argb (dark, for a silhouette), with nothing of what it is: no count, no tooltip, no link. What a locked page or element shows of the items it holds. A painter that can't tint items draws nothing.
      Specified by:
      silhouette in interface FoliosPainter
    • scene

      public void scene(net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewport viewport, int x, int y, int width, int height)
      Description copied from interface: FoliosPainter
      A scene's picture; the painter keeps it in use while it is drawn.
      Specified by:
      scene in interface FoliosPainter
    • scene

      public void scene(net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewport viewport, int x, int y, int width, int height, float u0, float u1)
      Description copied from interface: FoliosPainter
      As FoliosPainter.scene(SceneViewport, int, int, int, int), showing only the part of it from u0 to u1 across (0 to 1).
      Specified by:
      scene in interface FoliosPainter
    • scene

      public void scene(net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewport viewport, int x, int y, int width, int height, float u0, float v0, float u1, float v1, int argb)
      Description copied from interface: FoliosPainter
      As FoliosPainter.scene(SceneViewport, int, int, int, int), showing only the part of it from (u0, v0) to (u1, v1) (0 to 1, from its top left), tinted by argb: its alpha fades the picture.
      Specified by:
      scene in interface FoliosPainter
    • clip

      public void clip(int x, int y, int width, int height, Runnable draw)
      Description copied from interface: FoliosPainter
      Draws with what is drawn kept inside a box, (x, y) width by height in the painter's pixels. A painter that can't clip draws it all.
      Specified by:
      clip in interface FoliosPainter
    • push

      public void push()
      Specified by:
      push in interface FoliosPainter
    • pop

      public void pop()
      Specified by:
      pop in interface FoliosPainter
    • translate

      public void translate(float x, float y)
      Specified by:
      translate in interface FoliosPainter
    • scale

      public void scale(float factor)
      Specified by:
      scale in interface FoliosPainter
    • font

      public net.minecraft.client.gui.Font font()
      Specified by:
      font in interface FoliosPainter
    • palette

      public FoliosPalette palette()
      Specified by:
      palette in interface FoliosPainter
    • time

      public float time()
      Description copied from interface: FoliosPainter
      Seconds since the book was opened: for what moves or cycles on a page.
      Specified by:
      time in interface FoliosPainter
    • flat

      public boolean flat()
      Description copied from interface: FoliosPainter
      Whether the page is on a screen (true), or on a book in the world (false).
      Specified by:
      flat in interface FoliosPainter
    • hovered

      public boolean hovered(int x, int y, int width, int height)
      Description copied from interface: FoliosPainter
      Whether the pointer is over a rectangle; never while the page is turning or covered.
      Specified by:
      hovered in interface FoliosPainter
    • link

      public boolean link(int x, int y, int width, int height, String target)
      Description copied from interface: FoliosPainter
      Makes a rectangle open a link when pressed: entry:<id>, entry:<id>#<marker>, category:<id>, http(s)://..., or a bare entry id. Hovering it shows where it goes.
      Specified by:
      link in interface FoliosPainter
      Returns:
      whether it is hovered
    • action

      public boolean action(int x, int y, int width, int height, @Nullable net.minecraft.network.chat.Component tooltip, Runnable onPress)
      Description copied from interface: FoliosPainter
      Makes a rectangle run something when pressed (on the client, during the press).
      Specified by:
      action in interface FoliosPainter
      Parameters:
      tooltip - shown while it is hovered; null for none
      Returns:
      whether it is hovered
    • drag

      public boolean drag(int x, int y, int width, int height, FoliosPainter.Drag drag)
      Description copied from interface: FoliosPainter
      Makes a rectangle draggable: held with the left button, it is told how far the pointer moves until let go.
      Specified by:
      drag in interface FoliosPainter
      Returns:
      whether it is hovered
    • scroll

      public boolean scroll(int x, int y, int width, int height, FoliosPainter.Scroll scroll)
      Description copied from interface: FoliosPainter
      Makes a rectangle take the mouse wheel while the pointer is over it, rather than the wheel turning the page.
      Specified by:
      scroll in interface FoliosPainter
      Returns:
      whether it is hovered
    • tooltip

      public void tooltip(net.minecraft.network.chat.Component text)
      Description copied from interface: FoliosPainter
      Shows a tooltip at the pointer this frame.
      Specified by:
      tooltip in interface FoliosPainter
    • tooltip

      public void tooltip(List<net.minecraft.network.chat.Component> lines)
      Description copied from interface: FoliosPainter
      A tooltip of several lines: a name, then lines saying more.
      Specified by:
      tooltip in interface FoliosPainter
    • tooltip

      public void tooltip(net.minecraft.world.item.ItemStack stack)
      Specified by:
      tooltip in interface FoliosPainter