Skip to main content

Module book

Module book 

Source
Expand description

Guide books: the .ybook format and its renderer.

Modules§

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:
pattern
Patterns on a hexagonal grid (Hex Casting’s), drawn as its book draws them: a start direction and a signature of turns — w straight on, e/d 60°/120° right, q/a 60°/120° left, s back — as a “zappy” line (each stroke broken into little noisy hops, the same every time), dark inside a light outline, a blue dot where it starts, faint dots on the points it passes.
refs
References in a book: what a .ybook names — items, blocks, entities, recipes, its own entries and categories — it names through a typed reference, @item:minecraft:stick, never a bare game id. Tools check every reference (yog build: does it exist on every Minecraft version the mod targets?) and turn it into the id the game uses.
renderer
Book renderer: yog-ui lays the book out and draws its text and buttons; everything else goes through draw2d too — 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.

Structs§

Book
A guide book: what a .ybook file holds.
BookCategory
A category of the book’s home page.
BookEntry
One entry: its pages, in a category.
BookRenderer
BookTheme
All colors are 0xAARRGGBB.
BookViewState

Enums§

BookPage
One page of an entry: {"type": "spotlight", "item": "minecraft:stick", …}.

Constants§

BOOK_SHEET
The image source the book draws BOOK_PNG as: the loader ships it as assets/yog/textures/gui/book/book.png (Yog-IDLE resolves it to the bytes).
CRAFTING_SHEET
The image source the book draws CRAFTING_PNG as.

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 in assets/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 their mapping: ((x, y, z), block state).