Package mcp.mobius.waila.api.component
Class BarComponent
java.lang.Object
mcp.mobius.waila.api.component.BarComponent
- All Implemented Interfaces:
ITooltipComponent
Component that renders a colored bar.
-
Nested Class Summary
Nested classes/interfaces inherited from interface mcp.mobius.waila.api.ITooltipComponent
ITooltipComponent.HorizontalGrowing -
Constructor Summary
ConstructorsConstructorDescriptionBarComponent(float ratio, int color) BarComponent(float ratio, int color, String text) BarComponent(float ratio, int color, Component text) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the height of the component.intgetWidth()Returns the width of the component.voidrender(GuiGraphics ctx, int x, int y, DeltaTracker delta) Renders the component.
-
Constructor Details
-
BarComponent
public BarComponent(float ratio, int color) - Parameters:
ratio- the ratio of the filled bar between 0.0f and 1.0fcolor- the bar color, 0xAARRGGBB
-
BarComponent
- Parameters:
ratio- the ratio of the filled bar between 0.0f and 1.0fcolor- the bar color, 0xAARRGGBBtext- the text that will be shown in the middle of the bar
-
BarComponent
- Parameters:
ratio- the ratio of the filled bar between 0.0f and 1.0fcolor- the bar color, 0xAARRGGBBtext- the text that will be shown in the middle of the bar
-
-
Method Details
-
getWidth
public int getWidth()Description copied from interface:ITooltipComponentReturns the width of the component.Contract:
ITooltipComponent.getWidth()will be called first, thenITooltipComponent.getHeight().- Specified by:
getWidthin interfaceITooltipComponent
-
getHeight
public int getHeight()Description copied from interface:ITooltipComponentReturns the height of the component.Contract:
ITooltipComponent.getWidth()will be called first, thenITooltipComponent.getHeight().- Specified by:
getHeightin interfaceITooltipComponent
-
render
Description copied from interface:ITooltipComponentRenders the component.- Specified by:
renderin interfaceITooltipComponent
-