public class ComponentButton extends GuiComponent
| Modifier and Type | Field and Description |
|---|---|
boolean |
hasBackground |
protected java.lang.String |
text |
| Constructor and Description |
|---|
ComponentButton(Gui gui,
int x,
int y,
int sizeX,
int sizeY,
java.util.function.Supplier<java.lang.Boolean> supplier,
java.lang.String text,
java.lang.String... hover) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String[] |
getHover() |
IResourceName |
getName() |
protected java.lang.String |
getText() |
boolean |
onMouseAction(IGameInstance game,
int button,
float x,
float y) |
boolean |
onPressed(IGameInstance game) |
void |
render(IGameInstance game,
IAssetManager manager,
IGraphics g,
int x,
int y) |
void |
renderOverlay(IGameInstance game,
IAssetManager manager,
IGraphics g,
int x,
int y) |
ComponentButton |
setHasBackground(boolean has) |
void |
setText(java.lang.String text) |
getElementColor, getElementOutlineColor, getGuiColor, getHeight, getPriority, getRenderX, getRenderY, getUnselectedElementColor, getWidth, getX, getY, isActive, isMouseOver, isMouseOverPrioritized, onKeyboardAction, setActive, shouldDoFingerCursor, toString, updatepublic ComponentButton(Gui gui, int x, int y, int sizeX, int sizeY, java.util.function.Supplier<java.lang.Boolean> supplier, java.lang.String text, java.lang.String... hover)
public ComponentButton setHasBackground(boolean has)
public void render(IGameInstance game, IAssetManager manager, IGraphics g, int x, int y)
render in class GuiComponentprotected java.lang.String getText()
public void setText(java.lang.String text)
public void renderOverlay(IGameInstance game, IAssetManager manager, IGraphics g, int x, int y)
renderOverlay in class GuiComponentprotected java.lang.String[] getHover()
public boolean onMouseAction(IGameInstance game, int button, float x, float y)
onMouseAction in class GuiComponentpublic IResourceName getName()
getName in class GuiComponentpublic boolean onPressed(IGameInstance game)