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 —
wstraight on,e/d60°/120° right,q/a60°/120° left,sback — 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
.ybooknames — 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
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.
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": "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).