Class GuideLayout
java.lang.Object
net.ixdarklord.folios.api.client.page.GuideLayout
Where pages are laid out: the page's size and margins, the font, and helpers for the parts most pages have (a
title, and text that continues onto further pages).
Every page is 136 by 180 pixels, in both kinds of book; content sits between
the margins, from CONTENT_LEFT to CONTENT_RIGHT and CONTENT_TOP to
CONTENT_BOTTOM.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intUnder this is the page's number.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intHow many texture pixels a scene has for each page pixel it is shown over: enough for it to stay sharp on a handheld book held close and on large screens.static final intHow much room a title takes, its rule under it included. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbook()voidclose()Closes the scenes made for this layout.flow(@Nullable String title, int reserved, @Nullable String text, @Nullable GuidePage.Part part) A page with an optional title, a part of its ownreservedpixels tall under it, and text under that; text that doesn't fit runs on over as many more pages as it needs.net.minecraft.client.gui.Fontfont()Text set out to the content's width.static voidtitle(GuidePainter painter, net.minecraft.network.chat.Component title, int y) A page's title: bold, with the book's mark under it.net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewportviewport(int width, int height) A scene for a page to show (an entity, a structure), drawn to a texture ofwidthbyheightpixels (its size on the page timesSCENE_DETAIL).
-
Field Details
-
PAGE_WIDTH
public static final int PAGE_WIDTH- See Also:
-
PAGE_HEIGHT
public static final int PAGE_HEIGHT- See Also:
-
MARGIN
public static final int MARGIN- See Also:
-
CONTENT_LEFT
public static final int CONTENT_LEFT- See Also:
-
CONTENT_RIGHT
public static final int CONTENT_RIGHT- See Also:
-
CONTENT_WIDTH
public static final int CONTENT_WIDTH- See Also:
-
CONTENT_TOP
public static final int CONTENT_TOP- See Also:
-
CONTENT_BOTTOM
public static final int CONTENT_BOTTOMUnder this is the page's number.- See Also:
-
TITLE_HEIGHT
public static final int TITLE_HEIGHTHow much room a title takes, its rule under it included.- See Also:
-
SCENE_DETAIL
public static final int SCENE_DETAILHow many texture pixels a scene has for each page pixel it is shown over: enough for it to stay sharp on a handheld book held close and on large screens.- See Also:
-
-
Constructor Details
-
GuideLayout
-
-
Method Details
-
book
-
font
public net.minecraft.client.gui.Font font() -
text
-
flow
public List<GuidePage.Laid> flow(@Nullable String title, int reserved, @Nullable String text, @Nullable GuidePage.Part part) A page with an optional title, a part of its ownreservedpixels tall under it, and text under that; text that doesn't fit runs on over as many more pages as it needs.- Parameters:
part- draws the page's own part, given the height it starts at; null for none
-
title
A page's title: bold, with the book's mark under it. -
viewport
public net.ixdarklord.coolcatcanvas.api.client.viewport.SceneViewport viewport(int width, int height) A scene for a page to show (an entity, a structure), drawn to a texture ofwidthbyheightpixels (its size on the page timesSCENE_DETAIL). It belongs to this layout: it is closed when the book is laid out again. -
close
public void close()Closes the scenes made for this layout.
-