Struct Screen
pub struct Screen {
pub width: f32,
pub height: f32,
pub slots: Vec<Option<[f32; 2]>>,
pub inventory_y: f32,
pub inventory_x: f32,
pub own_labels: bool,
pub own_background: bool,
pub recipe_book: Option<RecipeBookTypeKey>,
pub recipe_book_toggle: Option<[f32; 2]>,
}Expand description
A mod block’s screen over its menu (native_screen): its size, where
each of the container’s slots is (Slot.x, Slot.y; none hides the
slot, and so do slots past the list; the server’s menu does not have a
hidden slot either, so clicks and shift-clicks skip it), and the player inventory’s first
row (vanilla’s is 84; the hotbar is 58 below it) and left column, from
its top left.
Fields§
§width: f32Vanilla’s container screens are 176 wide.
height: f32The screen’s height in GUI pixels; vanilla’s is 166.
slots: Vec<Option<[f32; 2]>>Each menu slot’s top-left (x, y), or None to hide it.
inventory_y: f32The y of the player inventory’s first row; vanilla’s is 84.
inventory_x: f32The inventory’s left column (vanilla’s is 8).
own_labels: boolThe mod draws the title and the “Inventory” label itself
(native_screen_draw); Horizon leaves them out.
own_background: boolThe mod draws its own background (native_screen_draw), so Horizon
leaves out the plain panel and the slot frames.
recipe_book: Option<RecipeBookTypeKey>The registered recipe book hosted beside this menu. Its declarations must target this menu; no panel is enabled until authoritative settings arrive. Leaving this unset keeps the screen without a recipe book.
recipe_book_toggle: Option<[f32; 2]>Optional 20 × 18 recipe-book toggle position relative to this menu. The screen author reserves this area, as vanilla screen templates do. Without an anchor the engine uses an external gutter; if none fits, the book is refused with a diagnostic while the menu remains usable.