Package mcp.mobius.waila.api.component
Class ProgressBarComponent
java.lang.Object
mcp.mobius.waila.api.component.ProgressBarComponent
- All Implemented Interfaces:
ITooltipComponent
,ITooltipComponent.HorizontalGrowing
Component that renders a horizontal progress bar.
-
Nested Class Summary
Nested classes/interfaces inherited from interface mcp.mobius.waila.api.ITooltipComponent
ITooltipComponent.HorizontalGrowing
-
Constructor Summary
ConstructorsConstructorDescriptionProgressBarComponent
(int height, int foreground, int background, float progress) -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the height of the component.int
Returns the minimal width of the component.void
render
(GuiGraphics ctx, int x, int y, DeltaTracker delta) Renders the component.void
setGrownWidth
(int grownWidth) Called with the calculated width.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface mcp.mobius.waila.api.ITooltipComponent.HorizontalGrowing
getWeight, getWidth
-
Constructor Details
-
ProgressBarComponent
public ProgressBarComponent(int height, int foreground, int background, float progress) - Parameters:
height
- the height of the barforeground
- the color of current progressbackground
- the background color
-
-
Method Details
-
getMinimalWidth
public int getMinimalWidth()Description copied from interface:ITooltipComponent.HorizontalGrowing
Returns the minimal width of the component.- Specified by:
getMinimalWidth
in interfaceITooltipComponent.HorizontalGrowing
-
setGrownWidth
public void setGrownWidth(int grownWidth) Description copied from interface:ITooltipComponent.HorizontalGrowing
Called with the calculated width.- Specified by:
setGrownWidth
in interfaceITooltipComponent.HorizontalGrowing
-
getHeight
public int getHeight()Description copied from interface:ITooltipComponent.HorizontalGrowing
Returns the height of the component.Contract:
ITooltipComponent.HorizontalGrowing.setGrownWidth(int)
will be called first, thenITooltipComponent.HorizontalGrowing.getHeight()
.- Specified by:
getHeight
in interfaceITooltipComponent
- Specified by:
getHeight
in interfaceITooltipComponent.HorizontalGrowing
-
render
Description copied from interface:ITooltipComponent
Renders the component.- Specified by:
render
in interfaceITooltipComponent
-