Class EdgeFadePainter
java.lang.Object
net.ixdarklord.folios.internal.client.paint.EdgeFadePainter
- All Implemented Interfaces:
GuidePainter
What a reveal effect draws over a page, faded out towards the page's edges and its fold, so sparks, smoke, light and
runes melt into the paper instead of stopping short at its border. Each thing drawn takes the fade of where its
middle is on the page; past the page it isn't drawn.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.ixdarklord.folios.api.client.page.GuidePainter
GuidePainter.Drag, GuidePainter.Scroll -
Constructor Summary
ConstructorsConstructorDescriptionEdgeFadePainter(GuidePainter painter, float x, float y, float scale) Wraps a page's painter; (x, y) andscaleare where its own pixels are on the page now. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaction(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, GuidePainter.Drag drag) Makes a rectangle draggable: held with the left button, it is told how far the pointer moves until let go.voidfill(int x0, int y0, int x1, int y1, int argb) booleanflat()Whether the page is on a screen (true), or on a book in the world (false).net.minecraft.client.gui.Fontfont()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) AsGuidePainter.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>#<anchor>,category:<id>,http(s)://..., or a bare entry id.palette()voidpop()voidpush()voidscale(float scale) voidscene(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.voidscene(net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewport viewport, int x, int y, int width, int height, float u0, float u1) AsGuidePainter.scene(SceneViewport, int, int, int, int), showing only the part of it fromu0tou1across (0 to 1).voidscene(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) AsGuidePainter.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 byargb: its alpha fades the picture.booleanscroll(int x, int y, int width, int height, GuidePainter.Scroll scroll) Makes a rectangle take the mouse wheel while the pointer is over it, rather than the wheel turning the page.voidtext(net.minecraft.network.chat.Component text, int x, int y, int argb) voidtext(net.minecraft.util.FormattedCharSequence text, int x, int y, int argb) voidtexture(net.minecraft.resources.ResourceLocation 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 byargb.floattime()Seconds since the book was opened: for what moves or cycles on a page.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) voidtranslate(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.GuidePainter
centeredText
-
Constructor Details
-
EdgeFadePainter
Wraps a page's painter; (x, y) andscaleare where its own pixels are on the page now.
-
-
Method Details
-
fill
public void fill(int x0, int y0, int x1, int y1, int argb) - Specified by:
fillin interfaceGuidePainter
-
text
public void text(net.minecraft.util.FormattedCharSequence text, int x, int y, int argb) - Specified by:
textin interfaceGuidePainter
-
text
public void text(net.minecraft.network.chat.Component text, int x, int y, int argb) - Specified by:
textin interfaceGuidePainter
-
texture
public void texture(net.minecraft.resources.ResourceLocation texture, int x, int y, int width, int height, float u0, float v0, float u1, float v1, int argb) Description copied from interface:GuidePainterA part of a texture, from its (u0, v0) to its (u1, v1), each 0 to 1, tinted byargb.- Specified by:
texturein interfaceGuidePainter
-
item
public void item(net.minecraft.world.item.ItemStack stack, int x, int y) Description copied from interface:GuidePainterAn 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 interfaceGuidePainter
-
item
public void item(net.minecraft.world.item.ItemStack stack, int x, int y, int argb) Description copied from interface:GuidePainterAsGuidePainter.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 interfaceGuidePainter
-
scene
public void scene(net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewport viewport, int x, int y, int width, int height) Description copied from interface:GuidePainterA scene's picture; the painter keeps it in use while it is drawn.- Specified by:
scenein interfaceGuidePainter
-
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:GuidePainterAsGuidePainter.scene(SceneViewport, int, int, int, int), showing only the part of it fromu0tou1across (0 to 1).- Specified by:
scenein interfaceGuidePainter
-
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:GuidePainterAsGuidePainter.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 byargb: its alpha fades the picture.- Specified by:
scenein interfaceGuidePainter
-
push
public void push()- Specified by:
pushin interfaceGuidePainter
-
pop
public void pop()- Specified by:
popin interfaceGuidePainter
-
translate
public void translate(float x, float y) - Specified by:
translatein interfaceGuidePainter
-
scale
public void scale(float scale) - Specified by:
scalein interfaceGuidePainter
-
font
public net.minecraft.client.gui.Font font()- Specified by:
fontin interfaceGuidePainter
-
palette
- Specified by:
palettein interfaceGuidePainter
-
time
public float time()Description copied from interface:GuidePainterSeconds since the book was opened: for what moves or cycles on a page.- Specified by:
timein interfaceGuidePainter
-
flat
public boolean flat()Description copied from interface:GuidePainterWhether the page is on a screen (true), or on a book in the world (false).- Specified by:
flatin interfaceGuidePainter
-
hovered
public boolean hovered(int x, int y, int width, int height) Description copied from interface:GuidePainterWhether the pointer is over a rectangle; never while the page is turning or covered.- Specified by:
hoveredin interfaceGuidePainter
-
link
Description copied from interface:GuidePainterMakes a rectangle open a link when pressed:entry:<id>,entry:<id>#<anchor>,category:<id>,http(s)://..., or a bare entry id. Hovering it shows where it goes.- Specified by:
linkin interfaceGuidePainter- 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:GuidePainterMakes a rectangle run something when pressed (on the client, during the press).- Specified by:
actionin interfaceGuidePainter- Parameters:
tooltip- shown while it is hovered; null for none- Returns:
- whether it is hovered
-
drag
Description copied from interface:GuidePainterMakes a rectangle draggable: held with the left button, it is told how far the pointer moves until let go.- Specified by:
dragin interfaceGuidePainter- Returns:
- whether it is hovered
-
scroll
Description copied from interface:GuidePainterMakes a rectangle take the mouse wheel while the pointer is over it, rather than the wheel turning the page.- Specified by:
scrollin interfaceGuidePainter- Returns:
- whether it is hovered
-
tooltip
public void tooltip(net.minecraft.network.chat.Component text) Description copied from interface:GuidePainterShows a tooltip at the pointer this frame.- Specified by:
tooltipin interfaceGuidePainter
-
tooltip
Description copied from interface:GuidePainterA tooltip of several lines: a name, then lines saying more.- Specified by:
tooltipin interfaceGuidePainter
-
tooltip
public void tooltip(net.minecraft.world.item.ItemStack stack) - Specified by:
tooltipin interfaceGuidePainter
-