API reference Obsidian.API.Client
MenuScreenProperties class
How the Obsidian client shows a mod's menu type, like a NeoForge mod's container screen: a background texture from the mod's assets with the menu's slots and the player's inventory on it. Register it with IClientRegistry.RegisterMenuScreen; without one, the menu shows like a chest, with its rows of slots centred.
public sealed class MenuScreenProperties
In Obsidian.API.Client.
Remarks
Positions are in the GUI's pixels from the background's top left, and a slot's is where its item's top left goes (vanilla's slot frames are 18 pixels, one around each 16-pixel item).
Constructors
public MenuScreenProperties();Properties
Height
public int Height { get; init; }The background's height, in pixels.
Inventory
public GuiPosition Inventory { get; init; }Where the first slot of the player's inventory goes: its three rows of nine, then the hotbar 58 pixels below the first row, like vanilla's menus.
InventoryLabel
public GuiPosition? InventoryLabel { get; init; }Where the "Inventory" label goes; if null, 12 pixels above the player's inventory, like on vanilla's 176 by 166 screens.
Slots
public required IReadOnlyList<GuiPosition> Slots { get; init; }Where the menu's slots go, one for each, in slot order (row by row).
Texture
public required string Texture { get; init; }The background, for example examplemod:gui/container/pouch for assets/examplemod/textures/gui/container/pouch.png; its top left MenuScreenProperties.Width by MenuScreenProperties.Height pixels are drawn, like vanilla's container textures.
Title
public GuiPosition Title { get; init; }Where the menu's title goes.
Width
public int Width { get; init; }The background's width, in pixels.