public abstract class GuiComponentButton extends BaseComponent
Modifier and Type | Field and Description |
---|---|
protected int |
height |
protected java.lang.String |
label |
protected int |
u |
protected int |
v |
protected int |
width |
fontRenderer, keyboardEventListener, mouseEventListener, parent, toolTip, xPos, yPos
Constructor and Description |
---|
GuiComponentButton(GuiBase<?> parent,
int xPos,
int yPos,
int uPos,
int vPos,
int w,
int h,
java.lang.String text)
Constructor for the button component
In your texture, you should put the hovered over texture directly below the main texture passed
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doAction()
Called when button is pressed
|
int |
getHeight()
Used to find how tall this is
|
java.lang.String |
getLabel() |
int |
getU()
Accessors/Mutators *
|
int |
getV() |
int |
getWidth()
Used to find how wide this is
|
boolean |
isMouseOver(int mouseX,
int mouseY)
Used to enable the hovered over texture
|
void |
mouseDown(double mouseX,
double mouseY,
int button)
Called when the mouse is pressed
|
void |
render(int guiLeft,
int guiTop,
int mouseX,
int mouseY)
Called to render the component
|
void |
renderOverlay(int guiLeft,
int guiTop,
int mouseX,
int mouseY)
Called after base render, is already translated to guiLeft and guiTop, just move offset
|
void |
setLabel(java.lang.String label) |
void |
setU(int u) |
void |
setV(int v) |
getArea, getDynamicToolTip, getKeyboardEventListener, getMouseEventListener, getParent, getToolTip, getXPos, getYPos, keyTyped, mouseDrag, mouseScrolled, mouseUp, renderToolTip, setKeyboardEventListener, setMouseEventListener, setParent, setToolTip, setXPos, setYPos
addButton, children, getMinecraft, getNarrationMessage, getTitle, getTooltipFromItem, handleComponentClicked, hasAltDown, hasControlDown, hasShiftDown, init, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, keyPressed, onClose, removed, render, renderBackground, renderBackground, renderComponentHoverEffect, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, setSize, shouldCloseOnEsc, tick, wrapScreenError
getFocused, isDragging, setDragging, setFocused
blit, blit, blit, blit, blit, drawCenteredString, drawRightAlignedString, drawString, fill, fillGradient, hLine, innerBlit, vLine
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected int u
protected int v
protected int width
protected int height
protected java.lang.String label
public GuiComponentButton(GuiBase<?> parent, int xPos, int yPos, int uPos, int vPos, int w, int h, @Nullable java.lang.String text)
parent
- The parent guixPos
- The x positionyPos
- The y positionuPos
- The texture u positionvPos
- The texture v positionw
- The widthh
- The heighttext
- The text to display, translatedprotected abstract void doAction()
public int getWidth()
getWidth
in class BaseComponent
public int getHeight()
getHeight
in class BaseComponent
public void mouseDown(double mouseX, double mouseY, int button)
mouseDown
in class BaseComponent
mouseX
- Mouse X PositionmouseY
- Mouse Y Positionbutton
- Mouse Buttonpublic boolean isMouseOver(int mouseX, int mouseY)
isMouseOver
in class BaseComponent
mouseX
- Mouse X PositionmouseY
- Mouse Y Positionpublic void render(int guiLeft, int guiTop, int mouseX, int mouseY)
render
in class BaseComponent
public void renderOverlay(int guiLeft, int guiTop, int mouseX, int mouseY)
renderOverlay
in class BaseComponent
public int getU()
public void setU(int u)
public int getV()
public void setV(int v)
public java.lang.String getLabel()
public void setLabel(java.lang.String label)