Aller au contenu
galdurdocs

GaldurWindow

classclient uniquementdepuis 0.1.0

com.galdurstudio.galdurui.api.window.GaldurWindow

Pas encore traduit : texte d’origine en anglais.

A screen described by a mod's code: title, texts, buttons, checkboxes, lists, tabs...

Created with GaldurLib.createWindow(). It only holds the description of the screen; layout, theme and rendering are handled by Galdur UI, and no coordinate ever needs computing.

The add...(...) methods inherited from ElementContainer add elements top to bottom, in call order. An element added while the window is shown appears on the next frame (call on the client thread).

public class GaldurWindow extends ElementContainer
PAQUETapi.window
CÔTÉclient uniquement

MEMBRES · 26

Constructeurs 1

GaldurWindow

public GaldurWindow()

Creates an empty window. Prefer GaldurLib.createWindow().

Méthodes 13

open

public void open()

Shows the window. No effect if it is already open or opening.

The screen shown until then is remembered: close() and Escape go back to it.

close

public void close()

Closes the window and goes back to the previous screen, exactly like Escape. No effect when it is closed.

isOpen

public boolean isOpen()

RENVOIEboolean — true if the window is on screen or opening

addTabs

2 surcharges
public TabsHandle addTabs()
public TabsHandle addTabs(boolean centered)

Adds a left-aligned tab row at the end of the window and returns its handle; see addTabs() to centre it.

Each tab has its own content, filled like a window. Only the active tab's content is shown, below the row; the window keeps the size of the largest content, so it does not resize when switching tabs.

PARAMÈTRES

centeredbooleantrue to centre it in the window, false to align it left

RENVOIETabsHandle — the tabs handle, used to add tabs and pick the active one

Code source ↗

addText

de ElementContainer2 surcharges
public ElementHandle addText(Component text)
public ElementHandle addText(Component text, boolean centered)

Adds a left-aligned line of text at the end; see addText() to centre it.

PARAMÈTRES

textComponentthe text to show
centeredbooleantrue to centre it, false to align it left

RENVOIEElementHandle — the element's handle (disable, hide, tooltip)

addTitle

de ElementContainer2 surcharges
public ElementHandle addTitle(Component text)
public ElementHandle addTitle(Component text, boolean centered)

Adds a left-aligned title at the end; see addTitle() to centre it.

A title differs from plain text by its style. It usually comes first, but nothing enforces it: elements stay in call order.

PARAMÈTRES

textComponentthe title to show
centeredbooleantrue to centre it, false to align it left

RENVOIEElementHandle — the element's handle (disable, hide, tooltip)

addButton

de ElementContainer2 surcharges
public ElementHandle addButton(Component label, Runnable action)
public ElementHandle addButton(Component label, Runnable action, boolean centered)

Adds a left-aligned button at the end; see addButton() to centre it.

The action runs every time the button is activated, by mouse or keyboard.

PARAMÈTRES

labelComponentthe button label
actionRunnablerun when the button is activated
centeredbooleantrue to centre it, false to align it left

RENVOIEElementHandle — the element's handle (disable, hide, tooltip)

addIconButton

de ElementContainer4 surcharges
public ElementHandle addIconButton(ItemStack icon, Component label, Runnable action)
public ElementHandle addIconButton(ItemStack icon, Component label, Runnable action, boolean centered)
public ElementHandle addIconButton(ResourceLocation sprite, Component label, Runnable action)
public ElementHandle addIconButton(ResourceLocation sprite, Component label, Runnable action, boolean centered)

Adds a left-aligned icon button showing an item at the end; see addIconButton() to centre it.

The label is not drawn on the button: it is the tooltip and the narrated text. A tooltip set on the handle replaces it. For several icons side by side, use a row (RowHandle.addIconButton()).

PARAMÈTRES

iconItemStackthe shown item; copied
labelComponenttooltip and narration text
actionRunnablerun when the button is activated
centeredbooleantrue to centre it, false to align it left
spriteResourceLocationsprite id in the GUI atlas

RENVOIEElementHandle — the element's handle (disable, hide, tooltip)

Code source ↗

addCheckbox

de ElementContainer2 surcharges
public CheckboxHandle addCheckbox(Component label, boolean defaultState)
public CheckboxHandle addCheckbox(Component label, boolean defaultState, boolean centered)

Adds a left-aligned checkbox at the end and returns its handle; see addCheckbox() to centre it.

The handle reads and changes the state, reports changes and, like any ElementHandle, disables, hides or gives a tooltip to the checkbox.

PARAMÈTRES

labelComponentthe text next to the box
defaultStatebooleantrue if the checkbox is checked on open
centeredbooleantrue to centre it, false to align it left

RENVOIECheckboxHandle — the checkbox handle

addRow

de ElementContainer2 surcharges
public RowHandle addRow()
public RowHandle addRow(boolean centered)

Adds a left-aligned row at the end and returns its handle, to place elements side by side; see addRow() to centre it.

PARAMÈTRES

centeredbooleantrue to centre it, false to align it left

RENVOIERowHandle — the row handle, used to add elements to it

Code source ↗

addList

de ElementContainer2 surcharges
public ListHandle addList(int visibleRows)
public ListHandle addList(int visibleRows, boolean centered)

Adds a left-aligned scrolling list at the end and returns its handle, which holds its lines and selection; see addList() to centre it.

PARAMÈTRES

visibleRowsintnumber of lines visible at once (at least 1); sets the height
centeredbooleantrue to centre it, false to align it left

RENVOIEListHandle — the list handle

Code source ↗

addSearch

de ElementContainer2 surcharges
public SearchHandle addSearch(Component placeholder)
public SearchHandle addSearch(Component placeholder, boolean centered)

Adds a left-aligned search field at the end and returns its handle, which holds the typed text; see addSearch() to centre it.

PARAMÈTRES

placeholderComponenthint text, shown while the field is empty
centeredbooleantrue to centre it, false to align it left

RENVOIESearchHandle — the field handle

Code source ↗

addProgress

de ElementContainer2 surcharges
public ProgressHandle addProgress(Component label)
public ProgressHandle addProgress(Component label, boolean centered)

Adds a left-aligned progress bar at the end and returns its handle, which holds its progress and text; see addProgress() to centre it.

PARAMÈTRES

labelComponentthe text shown on the bar, or null for none; it also sets the bar width (at least 100 pixels)
centeredbooleantrue to centre it, false to align it left

RENVOIEProgressHandle — the bar handle, empty at first

Code source ↗
© 2026 Galdur Studio · galdurstudio.com · Discord · LGPL-3.0-onlyProduit non officiel. Non approuvé par Mojang ou Microsoft, ni associé à eux.