Class AbstractPainter
java.lang.Object
net.ixdarklord.folios.internal.client.paint.AbstractPainter
- All Implemented Interfaces:
FoliosPainter
- Direct Known Subclasses:
ScreenPainter,WorldPainter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic interfaceNested classes/interfaces inherited from interface net.ixdarklord.folios.api.client.page.FoliosPainter
FoliosPainter.Drag, FoliosPainter.Scroll -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final net.minecraft.client.gui.Fontprotected final AbstractPainter.Navigatorprotected final FoliosPaletteprotected final FoliosSession -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPainter(FoliosPalette palette, FoliosSession session, AbstractPainter.Navigator navigator, float time, float pointerX, float pointerY, List<AbstractPainter.Hit> hits) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanaction(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).booleandrag(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.protected abstract voiddrawItem(net.minecraft.world.item.ItemStack stack, int x, int y, int argb) net.minecraft.client.gui.Fontfont()static voidhold(@Nullable AbstractPainter.Hit hit) booleanhovered(int x, int y, int width, int height) Whether the pointer is over a rectangle; never while the page is turning or covered.voiditem(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.voiditem(net.minecraft.world.item.ItemStack stack, int x, int y, int argb) AsFoliosPainter.item(ItemStack, int, int), tinted byargb: its alpha fades the item, its colour tints it (white leaves it as it is).booleanMakes a rectangle open a link when pressed:entry:<id>,entry:<id>#<marker>,category:<id>,http(s)://..., or a bare entry id.intprotected floatintThe 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).protected floatpageX(float x) protected floatpageY(float y) palette()voidpop()protected abstract voidpopped()@Nullable FoliosPopuppopup()voidpush()protected abstract voidpushed()voidquietItem(net.minecraft.world.item.ItemStack stack, int x, int y) AsFoliosPainter.item(ItemStack, int, int), with no tooltip and no link: for an icon that only decorates, like a page's heading.voidquietItem(net.minecraft.world.item.ItemStack stack, int x, int y, int argb) voidscale(float factor) protected abstract voidscaled(float factor) booleanscroll(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.voidsilhouette(net.minecraft.world.item.ItemStack stack, int x, int y, int argb) An item's shape tinted byargb(dark, for a silhouette), with nothing of what it is: no count, no tooltip, no link.floattime()Seconds since the book was opened: for what moves or cycles on a page.floattime(float step) The time, held still between multiples ofstepseconds: for something that changes only everystepseconds, like an item cycling through a tag.voidA tooltip of several lines: a name, then lines saying more.voidtooltip(net.minecraft.network.chat.Component text) Shows a tooltip at the pointer this frame.voidtooltip(net.minecraft.world.item.ItemStack stack) @Nullable List<net.minecraft.network.chat.Component>voidtranslate(float x, float y) protected abstract voidtranslated(float x, float y) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.ixdarklord.folios.api.client.page.FoliosPainter
centeredText, clip, contentBottom, contentRight, fill, flat, scene, scene, scene, text, text, texture
-
Field Details
-
font
protected final net.minecraft.client.gui.Font font -
palette
-
session
-
-
Constructor Details
-
Method Details
-
pageWidth
public int pageWidth()Description copied from interface:FoliosPainterThe 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:
pageWidthin interfaceFoliosPainter
-
pageHeight
public int pageHeight()- Specified by:
pageHeightin interfaceFoliosPainter
-
font
public net.minecraft.client.gui.Font font()- Specified by:
fontin interfaceFoliosPainter
-
palette
- Specified by:
palettein interfaceFoliosPainter
-
time
public float time()Description copied from interface:FoliosPainterSeconds since the book was opened: for what moves or cycles on a page.- Specified by:
timein interfaceFoliosPainter
-
time
public float time(float step) Description copied from interface:FoliosPainterThe time, held still between multiples ofstepseconds: for something that changes only everystepseconds, like an item cycling through a tag. Lets a painter keep what it drew until the next step.- Specified by:
timein interfaceFoliosPainter
-
popup
-
tooltipLines
-
push
public void push()- Specified by:
pushin interfaceFoliosPainter
-
pop
public void pop()- Specified by:
popin interfaceFoliosPainter
-
translate
public void translate(float x, float y) - Specified by:
translatein interfaceFoliosPainter
-
scale
public void scale(float factor) - Specified by:
scalein interfaceFoliosPainter
-
pageX
protected float pageX(float x) -
pageY
protected float pageY(float y) -
pageScale
protected float pageScale() -
pushed
protected abstract void pushed() -
popped
protected abstract void popped() -
translated
protected abstract void translated(float x, float y) -
scaled
protected abstract void scaled(float factor) -
hovered
public boolean hovered(int x, int y, int width, int height) Description copied from interface:FoliosPainterWhether the pointer is over a rectangle; never while the page is turning or covered.- Specified by:
hoveredin interfaceFoliosPainter
-
link
Description copied from interface:FoliosPainterMakes 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:
linkin interfaceFoliosPainter- Returns:
- whether it is hovered
-
action
public boolean action(int x, int y, int width, int height, @Nullable @Nullable net.minecraft.network.chat.Component tooltip, Runnable onPress) Description copied from interface:FoliosPainterMakes a rectangle run something when pressed (on the client, during the press).- Specified by:
actionin interfaceFoliosPaintertooltip- shown while it is hovered; null for none- Returns:
- whether it is hovered
-
drag
Description copied from interface:FoliosPainterMakes a rectangle draggable: held with the left button, it is told how far the pointer moves until let go.- Specified by:
dragin interfaceFoliosPainter- Returns:
- whether it is hovered
-
hold
-
scroll
Description copied from interface:FoliosPainterMakes a rectangle take the mouse wheel while the pointer is over it, rather than the wheel turning the page.- Specified by:
scrollin interfaceFoliosPainter- Returns:
- whether it is hovered
-
tooltip
Description copied from interface:FoliosPainterA tooltip of several lines: a name, then lines saying more.- Specified by:
tooltipin interfaceFoliosPainter
-
tooltip
public void tooltip(net.minecraft.network.chat.Component text) Description copied from interface:FoliosPainterShows a tooltip at the pointer this frame.- Specified by:
tooltipin interfaceFoliosPainter
-
tooltip
public void tooltip(net.minecraft.world.item.ItemStack stack) - Specified by:
tooltipin interfaceFoliosPainter
-
item
public void item(net.minecraft.world.item.ItemStack stack, int x, int y) Description copied from interface:FoliosPainterAn item's icon, 16 pixels square; hovering shows its tooltip, and it links to the book's entry about it, if any.- Specified by:
itemin interfaceFoliosPainter
-
quietItem
public void quietItem(net.minecraft.world.item.ItemStack stack, int x, int y) Description copied from interface:FoliosPainterAsFoliosPainter.item(ItemStack, int, int), with no tooltip and no link: for an icon that only decorates, like a page's heading.- Specified by:
quietItemin interfaceFoliosPainter
-
quietItem
public void quietItem(net.minecraft.world.item.ItemStack stack, int x, int y, int argb) -
item
public void item(net.minecraft.world.item.ItemStack stack, int x, int y, int argb) Description copied from interface:FoliosPainterAsFoliosPainter.item(ItemStack, int, int), tinted byargb: 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:
itemin interfaceFoliosPainter
-
silhouette
public void silhouette(net.minecraft.world.item.ItemStack stack, int x, int y, int argb) Description copied from interface:FoliosPainterAn item's shape tinted byargb(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:
silhouettein interfaceFoliosPainter
-
drawItem
protected abstract void drawItem(net.minecraft.world.item.ItemStack stack, int x, int y, int argb) -
above
-