Package mcp.mobius.waila.api.component
Class SpriteBarComponent
java.lang.Object
mcp.mobius.waila.api.component.SpriteBarComponent
- All Implemented Interfaces:
ITooltipComponent
Component that renders a bar with a texture as the foreground.
-
Nested Class Summary
Nested classes/interfaces inherited from interface mcp.mobius.waila.api.ITooltipComponent
ITooltipComponent.HorizontalGrowing
-
Constructor Summary
ConstructorDescriptionSpriteBarComponent
(float ratio, TextureAtlasSprite sprite, int regionWidth, int regionHeight, int tint, Component text) SpriteBarComponent
(float ratio, ResourceLocation texture, float u0, float u1, float v0, float v1, int regionWidth, int regionHeight, int tint, Component text) -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the height of the component.int
getWidth()
Returns the width of the component.void
render
(GuiGraphics ctx, int x, int y, DeltaTracker delta) Renders the component.
-
Constructor Details
-
SpriteBarComponent
public SpriteBarComponent(float ratio, ResourceLocation texture, float u0, float u1, float v0, float v1, int regionWidth, int regionHeight, int tint, Component text) -
SpriteBarComponent
public SpriteBarComponent(float ratio, TextureAtlasSprite sprite, int regionWidth, int regionHeight, int tint, Component text)
-
-
Method Details
-
getWidth
public int getWidth()Description copied from interface:ITooltipComponent
Returns the width of the component.Contract:
ITooltipComponent.getWidth()
will be called first, thenITooltipComponent.getHeight()
.- Specified by:
getWidth
in interfaceITooltipComponent
-
getHeight
public int getHeight()Description copied from interface:ITooltipComponent
Returns the height of the component.Contract:
ITooltipComponent.getWidth()
will be called first, thenITooltipComponent.getHeight()
.- Specified by:
getHeight
in interfaceITooltipComponent
-
render
Description copied from interface:ITooltipComponent
Renders the component.- Specified by:
render
in interfaceITooltipComponent
-