Skip to content

Class: GuiHelper ​

Defined in: packages/minerender/src/gui/GuiHelper.ts:23

Creates GUI positions and layer lists for MineRenderScene.addGui.

Constructors ​

Constructor ​

ts
new GuiHelper(): GuiHelper;

Returns ​

GuiHelper

Methods ​

book() ​

ts
static book(options?): Promise<GuiLayer[]>;

Defined in: packages/minerender/src/gui/GuiHelper.ts:55

Creates a 192×192 book page with optional arrows and supplied text. Buttons are hidden by default. Callers choose the page content and button states; this helper does not paginate or handle clicks.

Parameters ​

ParameterType
optionsGuiBookOptions

Returns ​

Promise<GuiLayer[]>


bossBar() ​

ts
static bossBar(options?): Promise<GuiLayer[]>;

Defined in: packages/minerender/src/gui/GuiHelper.ts:29

Creates a 182×5 boss bar using the active resource pack. Finite progress is clamped to 0–1. The fill crops the source image; explicit crops do not apply .mcmeta sprite scaling.

Parameters ​

ParameterType
optionsGuiBossBarOptions

Returns ​

Promise<GuiLayer[]>


container() ​

ts
static container(type, position?): Promise<GuiLayer[]>;

Defined in: packages/minerender/src/gui/GuiHelper.ts:86

Creates a container background. Use GUI_CONTAINER_LAYOUTS with inventorySlot to place its items.

Parameters ​

ParameterType
type"generic_54" | "crafting_table"
position[number, number]

Returns ​

Promise<GuiLayer[]>


inventorySlot() ​

ts
static inventorySlot(
   slot, 
   origin?, 
   offset?, 
   rowSize?
): [number, number];

Defined in: packages/minerender/src/gui/GuiHelper.ts:140

Calculates a slot's top-left position in GUI pixels.

Parameters ​

ParameterTypeDefault valueDescription
slotnumber | readonly [number, number]undefinedZero-based slot index, or [column, row].
originreadonly [number, number]...Position of the first slot.
offsetreadonly [number, number]...Horizontal and vertical spacing between slot origins, in pixels.
rowSizenumber9Slots per row when slot is an index.

Returns ​

[number, number]


recipe() ​

ts
static recipe(recipe, options?): GuiLayer[];

Defined in: packages/minerender/src/gui/GuiHelper.ts:146

Creates crafting-table layers for ingredients and the result, including its stack count.

Parameters ​

ParameterType
recipeGuiRecipe
optionsGuiRecipeOptions

Returns ​

GuiLayer[]


tooltip() ​

ts
static tooltip(lines, options?): Promise<GuiLayer[]>;

Defined in: packages/minerender/src/gui/GuiHelper.ts:112

Sizes a tooltip around supplied text; the first entry is its title.

Parameters ​

ParameterType
linesreadonly GuiText[]
optionsGuiTooltipOptions

Returns ​

Promise<GuiLayer[]>