ProgressHandle
classclient uniquementdepuis 0.1.0com.galdurstudio.galdurui.api.window.ProgressHandle
Pas encore traduit : texte d’origine en anglais.
Handle to a progress bar of a GaldurWindow: its progress and the text shown on it.
Returned by addProgress(...). The shown widget reads the progress and the text every
frame: change them as often as you like (every tick, for instance), even while the window is
open, without rebuilding the screen.
ProgressHandle craft = window.addProgress(Component.literal("Iron ingots: 0 / 64"));craft.setProgress(16, 64);craft.setLabel(Component.literal("Iron ingots: 16 / 64"));The bar width is computed when the screen is built, from the text. A longer text given later
is cut with "…" until the next rebuild (resize, or an element added to the window). Like any
ElementHandle, the bar can be disabled (muted colours), hidden or given a tooltip.
Call on the client thread.
MEMBRES · 11
Méthodes 10
getProgress
RENVOIEdouble — the progress, from 0 (empty) to 1 (full)
setProgress
2 surchargesChanges the progress.
PARAMÈTRES
0 (empty) to 1 (full); values outside are clamped, and
NaN counts as 00 or less, the bar is emptygetLabel
RENVOIEComponent — the text shown on the bar, or null if none
setLabel
Changes the text shown on the bar.
PARAMÈTRES
null for nonesetEnabled
de ElementHandleEnables or disables the element. No effect if it is already in that state.
PARAMÈTRES
false to disable itisEnabled
de ElementHandleRENVOIEboolean — true if the element is enabled (the default)
setVisible
de ElementHandleShows or hides the element. Hidden, it frees its space in the window. No effect if it is already in that state.
PARAMÈTRES
false to hide itisVisible
de ElementHandleRENVOIEboolean — true if the element is shown (the default)
setTooltip
de ElementHandleSets the text shown when the element is hovered.
PARAMÈTRES
null to remove itgetTooltip
de ElementHandleRENVOIEComponent — the tooltip text, or null if none