Expand description
Guide books: the .ybook format and its renderer.
Modules§
- layout
- Recipe layouts: how a kind of recipe is shown — in books and in
Yog-IDLE’s recipe editor. The game’s kinds have built-in layouts
(Patchouli’s: the crafting grid, the furnace strip, the smithing
strip, …); a mod lays out its own kinds, or the game’s, with a
.yuicomponent — drawn and arranged in the screen designer like any UI: - markup
- Book texts are Yog text (
yog_ui::rich:{b|…},{#rrggbb|…}, …) with two words of the book’s own, turned into Yog text’s when the book is prepared: - page_
type - A mod’s own kinds of page (
hexcasting:pattern): a.yuicomponent withbook_page="…"declares one — its properties are the page’s fields, its body what the page shows — andyog buildhands it to the book as aPageType. A page of the kind (CustomPage) is laid out by the book like the built-in ones; what only code can draw is adrawnelement (crate::BookPage::Drawn’s primitive). - refs
- References in a book: what a
.ybooknames — items, blocks, entities, recipes, its own entries and categories — it names through a typed reference,@item:minecraft:stick, never a bare game id. The schema (crate::Book’s#[derive(Schema)]) says which field takes what; tools check every reference through aResolve(yog build: does it exist on every Minecraft version the mod targets?) and get the id the game uses. - renderer
- Book renderer: yog-ui lays the book out and draws its text and
buttons; everything else goes through
draw2dtoo — the sprite sheets, item icons, SVG pages, entities — so the game and Yog-IDLE’s book designer run the same code. - state
- Per-book navigation state.
- theme
- Visual theme for book rendering.
- ui
- The
.yuiXML subset — whatyog buildand Yog-IDLE read screens, book pages and recipe layouts from: elements with attributes in source order and their lines, for messages.
Structs§
- Book
- A guide book: what a
.ybookfile holds. - Book
Category - A category of the book’s home page.
- Book
Entry - One entry: its pages, in a category.
- Book
Renderer - Book
Theme - All colors are 0xAARRGGBB.
- Book
View State
Enums§
- Book
Page - One page of an entry:
{"type": "spotlight", "item": "@item:minecraft:stick", …}.
Constants§
- BOOK_
SHEET - The image source the book draws
BOOK_PNGas: the loader ships it asassets/yog/textures/gui/book/book.png(Yog-IDLE resolves it to the bytes). - CRAFTING_
SHEET - The image source the book draws
CRAFTING_PNGas.
Statics§
- BOOK_
PNG - The book’s sprite sheet (cover, pages, separators, nameplate).
- CRAFTING_
PNG - The crafting-grid sprite sheet.
- LANG
- The book’s own words (
yog.book.*) per language, as the loader’s jars ship them inassets/yog/lang/(for hosts without them, like Yog-IDLE).
Functions§
- multiblock_
blocks - The blocks of a multiblock
pattern(layers top to bottom, rows of characters) with theirmapping: ((x, y, z), block state).
Type Aliases§
- Page
Drawer - Draws a mod’s picture (
BookPage::Drawn):(ctx, drawer, data, [x, y, w, h]).