-
Notifications
You must be signed in to change notification settings - Fork 0
Book Component Renders
The BookComponent Renders are an implementation for:
- `IBookCategory` -> `ICategoryRender`
- `IBookEntry` -> `IEntryRender`
- `IBookPage` -> `IPageRender`
There are some renders provided by the mod.
The mod provides to us two category renders: ImageCategoryRender
and ItemCategoryRender
You can make your custom render with a class that implements the ICategoryRender
interface.
There a little example of how a custom render class looks (empty):
public final class ExampleCustomCategoryRender implements ICategoryRender {
public void render (GuiGraphics pGraphics, RegistryAccess pAccess, int pCategoryX, int pCategoryY, int pMouseX, int pMouseY, IBookCategory pCategory, IModScreen pScreen, Font pFont) {
// Your render logic here.
}
}
The mod provides to us two entry renders like the category renders provided:
One of these renders is for Images and other for Items.
- `ImageEntryRender`
- `ItemCategoryRender`
These two entry renders extends the abstract `EntryRender` class.
There is a little example of a custom entry render class using the EntryRender class(empty):
public final class ExampleCustomEntryRender extends EntryRender {
public ExampleCustomEntryRender ( Component pName ) {
super(pName);
}
public void render (GuiGraphics pGraphics, RegistryAccess pAccess, int pEntryX, int pEntryY, int pMouseX, int pMouseY, IBookEntry pCategory, IModScreen pScreen, Font pFont) {
// Your render logic here, the entry render class do the movement and logic of all the entry.
}
}
Also you can make it for 0 using the IEntryRender
interface, is valid.
The mod like all the other component renders have some renders for the pages.
This render is really simple, just render text on the page.
This is another simple render, just render an imagen on the center of the page.
This render is some like the `TextPageRender` the difference here is that just render an image below the text.
This render is a render of an entity on the center of the page, nothing more.
The EntityTextPageRender is like the EntityPageRender but the entity is above the text.
This page render is a little more complex, this takes an Recipe Render and a Recipe to make the render.
Like all the other component renders, you can make your custom page renders implementing the IPageRender
on a class.
public class ExampleEmptyPageRender implements IPageRender {
public void render (GuiGraphics pGraphics, RegistryAccess pAccess, int pMouseX, int pMouseY, IModScreen pScreen, Font pFont) {}
}
However all this renders ( Or at least the majority ) are in the Example Book (doesn't care if is in NeoForge or fabric or any platform, it work in the same mode.)