Class: GuiHelper
Defined in: packages/minerender/src/gui/GuiHelper.ts:23
Creates GUI positions and layer lists for MineRenderScene.addGui.
Constructors
Constructor
new GuiHelper(): GuiHelper;Returns
GuiHelper
Methods
book()
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
| Parameter | Type |
|---|---|
options | GuiBookOptions |
Returns
Promise<GuiLayer[]>
bossBar()
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
| Parameter | Type |
|---|---|
options | GuiBossBarOptions |
Returns
Promise<GuiLayer[]>
container()
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
| Parameter | Type |
|---|---|
type | "generic_54" | "crafting_table" |
position | [number, number] |
Returns
Promise<GuiLayer[]>
inventorySlot()
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
| Parameter | Type | Default value | Description |
|---|---|---|---|
slot | number | readonly [number, number] | undefined | Zero-based slot index, or [column, row]. |
origin | readonly [number, number] | ... | Position of the first slot. |
offset | readonly [number, number] | ... | Horizontal and vertical spacing between slot origins, in pixels. |
rowSize | number | 9 | Slots per row when slot is an index. |
Returns
[number, number]
recipe()
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
| Parameter | Type |
|---|---|
recipe | GuiRecipe |
options | GuiRecipeOptions |
Returns
GuiLayer[]
tooltip()
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
| Parameter | Type |
|---|---|
lines | readonly GuiText[] |
options | GuiTooltipOptions |
Returns
Promise<GuiLayer[]>