ProgressHandle
classclient onlysince 0.1.0com.galdurstudio.galdurui.api.window.ProgressHandle
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.
MEMBERS · 11
Methods 10
getProgress
RETURNSdouble — the progress, from 0 (empty) to 1 (full)
setProgress
2 overloadsChanges the progress.
PARAMETERS
0 (empty) to 1 (full); values outside are clamped, and
NaN counts as 00 or less, the bar is emptygetLabel
RETURNSComponent — the text shown on the bar, or null if none
setLabel
Changes the text shown on the bar.
PARAMETERS
null for nonesetEnabled
from ElementHandleEnables or disables the element. No effect if it is already in that state.
PARAMETERS
false to disable itisEnabled
from ElementHandleRETURNSboolean — true if the element is enabled (the default)
setVisible
from ElementHandleShows or hides the element. Hidden, it frees its space in the window. No effect if it is already in that state.
PARAMETERS
false to hide itisVisible
from ElementHandleRETURNSboolean — true if the element is shown (the default)
setTooltip
from ElementHandleSets the text shown when the element is hovered.
PARAMETERS
null to remove itgetTooltip
from ElementHandleRETURNSComponent — the tooltip text, or null if none