Class WorldPainter

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

public final class WorldPainter extends AbstractPainter
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    A curved page: where a point of it is in the pose's space, and which way its axes point there.

    Nested classes/interfaces inherited from class AbstractPainter

    AbstractPainter.Hit, AbstractPainter.Navigator

    Nested classes/interfaces inherited from interface FoliosPainter

    FoliosPainter.Drag, FoliosPainter.Scroll
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final float
    How high above the page its content reaches on a full page (some 150 things drawn, items on top): a leaf over it stays above this.
    static final net.minecraft.resources.Identifier
     

    Fields inherited from class AbstractPainter

    font, navigator, palette, session
  • Constructor Summary

    Constructors
    Constructor
    Description
    WorldPainter(com.mojang.blaze3d.vertex.PoseStack pose, net.minecraft.client.renderer.SubmitNodeCollector collector, int light, FoliosPalette palette, FoliosSession session, AbstractPainter.Navigator navigator, float time, float pointerX, float pointerY, List<AbstractPainter.Hit> hits)
     
    WorldPainter(com.mojang.blaze3d.vertex.PoseStack pose, net.minecraft.client.renderer.SubmitNodeCollector collector, int light, FoliosPalette palette, FoliosSession session, AbstractPainter.Navigator navigator, float time, float pointerX, float pointerY, List<AbstractPainter.Hit> hits, @Nullable WorldPainter.Surface surface)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Draws over everything drawn so far, items included (which otherwise lie over flat things drawn after them): for a reveal's effect about an item or over a whole page.
    void
    cutout(net.minecraft.resources.Identifier texture, int x, int y, int width, int height, float u0, float v0, float u1, float v1, int argb)
    A texture whose see-through pixels are cut away rather than blended: for a shape cut out of its texture (a ribbon's swallowtail, a plate's rounded corners) over things drawn after it, which a blended one's clear corners would hide.
    protected void
    drawItem(net.minecraft.world.item.ItemStack stack, int x, int y, int argb)
    Draws an item, tinted by argb (white and opaque: as it is).
    void
    end()
    Ends the page: sends its plain shapes and undoes its moves.
    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).
    lightAs(org.joml.Vector3f normal)
    Lights everything on the page as if it faced this way (a direction in view space), whichever way it turns.
    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
    paper(float x0, float y0, float x1, float y1, int color)
    The paper itself, under everything else, over a rectangle of the page.
    void
    paper(float x0, float y0, float x1, float y1, int color, net.minecraft.resources.Identifier texture)
    The paper itself from a texture, tinted, under everything else, over a rectangle of the page.
    void
    paper(float x0, float y0, float x1, float y1, int color, net.minecraft.resources.Identifier texture, float fold, int shade, boolean spineRight)
    The paper from a texture, darkening smoothly to shade over the last fold pixels before its spine edge (its right edge for spineRight, else its left): the shadow of a book's fold, in the paper itself so nothing lies over it.
    protected void
     
    void
    printing(boolean printing)
    Whether what is drawn now is printed on the leaf, at its pages' size, rather than the leaf's own frame and chrome.
    protected void
     
    protected void
    scaled(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.
    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.
    protected void
    translated(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
  • Field Details

    • WHITE

      public static final net.minecraft.resources.Identifier WHITE
    • HEIGHT

      public static final float HEIGHT
      How high above the page its content reaches on a full page (some 150 things drawn, items on top): a leaf over it stays above this.
      See Also:
  • Constructor Details

  • Method Details

    • lightAs

      public WorldPainter lightAs(org.joml.Vector3f normal)
      Lights everything on the page as if it faced this way (a direction in view space), whichever way it turns.
    • printing

      public void printing(boolean printing)
      Whether what is drawn now is printed on the leaf, at its pages' size, rather than the leaf's own frame and chrome.
    • 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
      Overrides:
      pageWidth in class AbstractPainter
    • pageHeight

      public int pageHeight()
      Specified by:
      pageHeight in interface FoliosPainter
      Overrides:
      pageHeight in class AbstractPainter
    • end

      public void end()
      Ends the page: sends its plain shapes and undoes its moves.
    • 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).
    • above

      public void above(Runnable draw)
      Description copied from class: AbstractPainter
      Draws over everything drawn so far, items included (which otherwise lie over flat things drawn after them): for a reveal's effect about an item or over a whole page.
      Overrides:
      above in class AbstractPainter
    • paper

      public void paper(float x0, float y0, float x1, float y1, int color)
      The paper itself, under everything else, over a rectangle of the page.
    • fill

      public void fill(int x0, int y0, int x1, int y1, int argb)
    • text

      public void text(net.minecraft.util.FormattedCharSequence text, int x, int y, int argb)
    • 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.
    • cutout

      public void cutout(net.minecraft.resources.Identifier texture, int x, int y, int width, int height, float u0, float v0, float u1, float v1, int argb)
      A texture whose see-through pixels are cut away rather than blended: for a shape cut out of its texture (a ribbon's swallowtail, a plate's rounded corners) over things drawn after it, which a blended one's clear corners would hide. Opaque only: its colour's alpha is ignored.
    • paper

      public void paper(float x0, float y0, float x1, float y1, int color, net.minecraft.resources.Identifier texture)
      The paper itself from a texture, tinted, under everything else, over a rectangle of the page.
    • paper

      public void paper(float x0, float y0, float x1, float y1, int color, net.minecraft.resources.Identifier texture, float fold, int shade, boolean spineRight)
      The paper from a texture, darkening smoothly to shade over the last fold pixels before its spine edge (its right edge for spineRight, else its left): the shadow of a book's fold, in the paper itself so nothing lies over it.
    • drawItem

      protected void drawItem(net.minecraft.world.item.ItemStack stack, int x, int y, int argb)
      Description copied from class: AbstractPainter
      Draws an item, tinted by argb (white and opaque: as it is).
      Specified by:
      drawItem in class AbstractPainter
    • 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.
    • 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).
    • 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.
    • pushed

      protected void pushed()
      Specified by:
      pushed in class AbstractPainter
    • popped

      protected void popped()
      Specified by:
      popped in class AbstractPainter
    • translated

      protected void translated(float x, float y)
      Specified by:
      translated in class AbstractPainter
    • scaled

      protected void scaled(float factor)
      Specified by:
      scaled in class AbstractPainter